summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Porter <mporter@konsulko.com>2016-12-19 13:55:11 -0500
committerMatt Porter <mporter@konsulko.com>2016-12-21 08:24:39 -0500
commit392effc544e3d94b82f806378d4ac1d11a185422 (patch)
tree6467743066dd6153941529087fef244dc8639c24
AGL-style PulseAudio mixer app
Change-Id: I566050a1a8f241f140523df236de81ab951c1394 Signed-off-by: Matt Porter <mporter@konsulko.com>
-rw-r--r--.gitignore1
-rw-r--r--.gitreview5
-rw-r--r--LICENSE54
-rw-r--r--README.md17
-rw-r--r--app/Mixer.qml93
-rw-r--r--app/Mixer.qrc5
-rw-r--r--app/app.pri12
-rw-r--r--app/app.pro18
-rw-r--r--app/main.cpp56
-rw-r--r--app/pac.c225
-rw-r--r--app/pac.h54
-rw-r--r--app/pacontrolmodel.cpp172
-rw-r--r--app/pacontrolmodel.h87
-rw-r--r--mixer.pro3
-rw-r--r--package/config.xml11
-rw-r--r--package/icon.svg439
-rw-r--r--package/package.pro19
17 files changed, 1271 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..89f64c7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.pro.*
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 0000000..a167f82
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=gerrit.automotivelinux.org
+port=29418
+project=apps/mixer
+defaultbranch=master
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..31c692a
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,54 @@
+Apache License
+
+Version 2.0, January 2004
+
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+ You must give any other recipients of the Work or Derivative Works a copy of this License; and
+ You must cause any modified files to carry prominent notices stating that You changed the files; and
+ You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+ If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..76d5a39
--- /dev/null
+++ b/README.md
@@ -0,0 +1,17 @@
+# Mixer application
+
+A simple AGL-style PulseAudio mixer app.
+
+## Features
+
+ * Supports all reported sinks and sources
+ * Multi-channel support via a per-channel volume control slider
+
+## Limitations
+
+ * No source-output or sink-input support
+ * No mute toggle support
+ * No channel slider binding
+ * No logarithmic volume control
+ * No event support (does not listen or respond to PA events from other clients)
+ * Fixed raw volume range
diff --git a/app/Mixer.qml b/app/Mixer.qml
new file mode 100644
index 0000000..7a099ce
--- /dev/null
+++ b/app/Mixer.qml
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2016 Konsulko Group
+ *
+ * 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.
+ */
+
+import QtQuick 2.6
+import QtQuick.Layouts 1.1
+import QtQuick.Controls 2.0
+import AGL.Demo.Controls 1.0
+import PaControlModel 1.0
+
+ApplicationWindow {
+ id: root
+
+ Label {
+ id: title
+ font.pixelSize: 48
+ text: "Mixer"
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+
+ Component {
+ id: ctldesc
+ Label {
+ font.pixelSize: 32
+ width: listView.width
+ wrapMode: Text.WordWrap
+ property var typeString: {modelType ? "Output" : "Input"}
+ text: "[" + typeString + " #" + modelCIndex + "]: " + modelDesc
+ }
+ }
+
+ Component {
+ id: empty
+ Item {
+ }
+ }
+
+ ListView {
+ id: listView
+ anchors.left: parent.left
+ anchors.top: title.bottom
+ anchors.margins: 80
+ anchors.fill: parent
+ model: PaControlModel {}
+ delegate: ColumnLayout {
+ width: parent.width
+ spacing: 40
+ Loader {
+ property int modelType: type
+ property int modelCIndex: cindex
+ property string modelDesc: desc
+ sourceComponent: (channel == 0) ? ctldesc : empty
+ }
+ RowLayout {
+ Layout.minimumHeight: 75
+ Label {
+ font.pixelSize: 24
+ text: cdesc
+ Layout.minimumWidth: 150
+ }
+ Label {
+ font.pixelSize: 24
+ text: "0 %"
+ }
+ Slider {
+ Layout.fillWidth: true
+ from: 0
+ to: 65536
+ stepSize: 256
+ snapMode: Slider.SnapOnRelease
+ onValueChanged: volume = value
+ Component.onCompleted: value = volume
+ }
+ Label {
+ font.pixelSize: 24
+ text: "100 %"
+ }
+ }
+ }
+ }
+}
diff --git a/app/Mixer.qrc b/app/Mixer.qrc
new file mode 100644
index 0000000..27f216c
--- /dev/null
+++ b/app/Mixer.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>Mixer.qml</file>
+ </qresource>
+</RCC>
diff --git a/app/app.pri b/app/app.pri
new file mode 100644
index 0000000..014646f
--- /dev/null
+++ b/app/app.pri
@@ -0,0 +1,12 @@
+TEMPLATE = app
+
+load(configure)
+qtCompileTest(libhomescreen)
+
+config_libhomescreen {
+ CONFIG += link_pkgconfig
+ PKGCONFIG += homescreen
+ DEFINES += HAVE_LIBHOMESCREEN
+}
+
+DESTDIR = $${OUT_PWD}/../package/root/bin
diff --git a/app/app.pro b/app/app.pro
new file mode 100644
index 0000000..e8fe05b
--- /dev/null
+++ b/app/app.pro
@@ -0,0 +1,18 @@
+TARGET = mixer
+QT = quickcontrols2
+
+HEADERS += \
+ pacontrolmodel.h \
+ pac.h
+
+SOURCES = main.cpp \
+ pacontrolmodel.cpp \
+ pac.c
+
+CONFIG += link_pkgconfig
+PKGCONFIG += libpulse
+
+RESOURCES += \
+ Mixer.qrc
+
+include(app.pri)
diff --git a/app/main.cpp b/app/main.cpp
new file mode 100644
index 0000000..d89287c
--- /dev/null
+++ b/app/main.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2016 The Qt Company Ltd.
+ * Copyright (C) 2016 Konsulko Group
+ *
+ * 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.
+ */
+
+#include <QtCore/QDebug>
+#include <QtCore/QDir>
+#include <QtCore/QStandardPaths>
+#include <QtGui/QGuiApplication>
+#include <QtQml/QQmlApplicationEngine>
+#include <QtQml/QQmlContext>
+#include <QtQml/qqml.h>
+#include <QtQuickControls2/QQuickStyle>
+#include <QtQuick/qquickitem.h>
+#include <QtQuick/qquickview.h>
+
+#include "pacontrolmodel.h"
+
+#ifdef HAVE_LIBHOMESCREEN
+#include <libhomescreen.hpp>
+#endif
+
+int main(int argc, char *argv[])
+{
+#ifdef HAVE_LIBHOMESCREEN
+ LibHomeScreen libHomeScreen;
+
+ if (!libHomeScreen.renderAppToAreaAllowed(0, 1)) {
+ qWarning() << "renderAppToAreaAllowed is denied";
+ return -1;
+ }
+#endif
+
+ QGuiApplication app(argc, argv);
+
+ QQuickStyle::setStyle("AGL");
+
+ qmlRegisterType<PaControlModel>("PaControlModel", 1, 0, "PaControlModel");
+
+ QQmlApplicationEngine engine;
+ engine.load(QUrl(QStringLiteral("qrc:/Mixer.qml")));
+
+ return app.exec();
+}
diff --git a/app/pac.c b/app/pac.c
new file mode 100644
index 0000000..83b4604
--- /dev/null
+++ b/app/pac.c
@@ -0,0 +1,225 @@
+/*
+ * Copyright (C) 2016 Konsulko Group
+ *
+ * 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.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <signal.h>
+#include <errno.h>
+#include <unistd.h>
+#include <limits.h>
+#include <assert.h>
+
+#include <pulse/pulseaudio.h>
+#include <sys/queue.h>
+
+#include "pacontrolmodel.h"
+#include "pac.h"
+
+/* FIXME: move these into a pac context */
+static pa_threaded_mainloop* m;
+TAILQ_HEAD(pac_cstateq, pac_cstate);
+static struct pac_cstateq cstateq;
+
+static void add_one_cstate(int type, int index, const pa_cvolume *cvolume)
+{
+ struct pac_cstate *cstate;
+ int i;
+
+ cstate = pa_xnew(struct pac_cstate, 1);
+ cstate->type = type;
+ cstate->index = index;
+ cstate->cvolume.channels = cvolume->channels;
+ for (i = 0; i < cvolume->channels; i++)
+ cstate->cvolume.values[i] = cvolume->values[i];
+
+ TAILQ_INSERT_TAIL(&cstateq, cstate, tailq);
+}
+
+static void get_source_list_cb(pa_context *c,
+ const pa_source_info *i,
+ int eol,
+ void *data)
+{
+ int chan;
+
+ if (eol < 0) {
+ fprintf(stderr, "get source list: %s\n",
+ pa_strerror(pa_context_errno(c)));
+
+ pa_threaded_mainloop_stop(m);
+ return;
+ }
+
+ if (!eol) {
+ assert(i);
+ add_one_cstate(C_SOURCE, i->index, &i->volume);
+ for (chan = 0; chan < i->channel_map.channels; chan++) {
+ add_one_control(data, i->index, i->description,
+ C_SOURCE, chan,
+ channel_position_string[i->channel_map.map[chan]],
+ i->volume.values[chan]);
+ }
+ }
+}
+
+static void get_sink_list_cb(pa_context *c,
+ const pa_sink_info *i,
+ int eol,
+ void *data)
+{
+ int chan;
+
+ if(eol < 0) {
+ fprintf(stderr, "get sink list: %s\n",
+ pa_strerror(pa_context_errno(c)));
+
+ pa_threaded_mainloop_stop(m);
+ return;
+ }
+
+ if(!eol) {
+ assert(i);
+ add_one_cstate(C_SINK, i->index, &i->volume);
+ for (chan = 0; chan < i->channel_map.channels; chan++) {
+ add_one_control(data, i->index, i->description,
+ C_SINK, chan,
+ channel_position_string[i->channel_map.map[chan]],
+ i->volume.values[chan]);
+ }
+ }
+}
+
+static void context_state_cb(pa_context *c, void *data) {
+ pa_operation *o;
+
+ assert(c);
+ switch (pa_context_get_state(c)) {
+ case PA_CONTEXT_CONNECTING:
+ case PA_CONTEXT_AUTHORIZING:
+ case PA_CONTEXT_SETTING_NAME:
+ break;
+ case PA_CONTEXT_READY:
+ /* Fetch the controls of interest */
+ if (!(o = pa_context_get_source_info_list(c, get_source_list_cb, data))) {
+ fprintf(stderr, "get source info list: %s\n",
+ pa_strerror(pa_context_errno(c)));
+ return;
+ }
+ pa_operation_unref(o);
+ if (!(o = pa_context_get_sink_info_list(c, get_sink_list_cb, data))) {
+ fprintf(stderr, "get sink info list: %s\n",
+ pa_strerror(pa_context_errno(c)));
+ return;
+ }
+ break;
+ case PA_CONTEXT_TERMINATED:
+ pa_threaded_mainloop_stop(m);
+ break;
+ case PA_CONTEXT_FAILED:
+ default:
+ fprintf(stderr, "PA connection failed: %s\n",
+ pa_strerror(pa_context_errno(c)));
+ pa_threaded_mainloop_stop(m);
+ }
+}
+
+static void pac_set_source_volume_cb(pa_context *c, int success, void *userdata __attribute__((unused))) {
+ assert(c);
+ if (!success)
+ fprintf(stderr, "Set source volume: %s\n",
+ pa_strerror(pa_context_errno(c)));
+}
+
+static void pac_set_sink_volume_cb(pa_context *c, int success, void *userdata __attribute__((unused))) {
+ assert(c);
+ if (!success)
+ fprintf(stderr, "Set source volume: %s\n",
+ pa_strerror(pa_context_errno(c)));
+}
+
+void pac_set_volume(pa_context *c, uint32_t type, uint32_t idx, uint32_t channel, uint32_t volume)
+{
+ pa_operation *o;
+ struct pac_cstate *cstate;
+
+ TAILQ_FOREACH(cstate, &cstateq, tailq)
+ if (cstate->index == idx)
+ break;
+ cstate->cvolume.values[channel] = volume;
+
+ if (type == C_SOURCE) {
+ if (!(o = pa_context_set_source_volume_by_index(c, idx, &cstate->cvolume, pac_set_source_volume_cb, NULL))) {
+ fprintf(stderr, "set source #%d channel #%d volume: %s\n",
+ idx, channel, pa_strerror(pa_context_errno(c)));
+ return;
+ }
+ pa_operation_unref(o);
+ } else if (type == C_SINK) {
+ if (!(o = pa_context_set_sink_volume_by_index(c, idx, &cstate->cvolume, pac_set_sink_volume_cb, NULL))) {
+ fprintf(stderr, "set sink #%d channel #%d volume: %s\n",
+ idx, channel, pa_strerror(pa_context_errno(c)));
+ return;
+ }
+ pa_operation_unref(o);
+ }
+}
+
+pa_context *pac_init(void *this, const char *name) {
+ pa_context *c;
+ pa_mainloop_api *mapi;
+ char *server = NULL;
+ char *client = pa_xstrdup(name);
+
+ TAILQ_INIT(&cstateq);
+
+ if (!(m = pa_threaded_mainloop_new())) {
+ fprintf(stderr, "pa_mainloop_new() failed.\n");
+ return NULL;
+ }
+
+ pa_threaded_mainloop_set_name(m, "pa_mainloop");
+ mapi = pa_threaded_mainloop_get_api(m);
+
+ if (!(c = pa_context_new(mapi, client))) {
+ fprintf(stderr, "pa_context_new() failed.\n");
+ goto exit;
+ }
+
+ pa_context_set_state_callback(c, context_state_cb, this);
+ if (pa_context_connect(c, server, 0, NULL) < 0) {
+ fprintf(stderr, "pa_context_connect(): %s", pa_strerror(pa_context_errno(c)));
+ goto exit;
+ }
+
+ if (pa_threaded_mainloop_start(m) < 0) {
+ fprintf(stderr, "pa_mainloop_run() failed.\n");
+ goto exit;
+ }
+
+ return c;
+
+exit:
+ if (c)
+ pa_context_unref(c);
+
+ if (m)
+ pa_threaded_mainloop_free(m);
+
+ pa_xfree(client);
+
+ return NULL;
+}
diff --git a/app/pac.h b/app/pac.h
new file mode 100644
index 0000000..ef0209d
--- /dev/null
+++ b/app/pac.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2016 Konsulko Group
+ *
+ * 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.
+ */
+
+#include <pulse/pulseaudio.h>
+#include <sys/queue.h>
+
+#ifdef __cplusplus
+extern "C" void pac_set_volume(pa_context *, uint32_t, uint32_t, uint32_t, uint32_t);
+extern "C" pa_context *pac_init(void *, const char *);
+#else
+static char * channel_position_string[] =
+{
+ "Mono",
+ "Front Left",
+ "Front Right",
+ "Center",
+ "Rear Center",
+ "Rear Left",
+ "Rear Right",
+ "LFE",
+ "Left Center",
+ "Right Center",
+ "Side Left",
+ "Side Right",
+};
+
+enum control_type
+{
+ C_SOURCE,
+ C_SINK
+};
+
+struct pac_cstate
+{
+ TAILQ_ENTRY(pac_cstate) tailq;
+ int type;
+ uint32_t index;
+ pa_cvolume cvolume;
+};
+
+#endif
diff --git a/app/pacontrolmodel.cpp b/app/pacontrolmodel.cpp
new file mode 100644
index 0000000..520233b
--- /dev/null
+++ b/app/pacontrolmodel.cpp
@@ -0,0 +1,172 @@
+/*
+ * Copyright (C) 2016 Konsulko Group
+ *
+ * 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.
+ */
+
+#include "pacontrolmodel.h"
+#include "pac.h"
+
+PaControl::PaControl(const quint32 &cindex, const QString &desc, const quint32 &type, const quint32 &channel, const QString &cdesc, const quint32 &volume)
+ : m_cindex(cindex), m_desc(desc), m_type(type), m_channel(channel), m_cdesc(cdesc), m_volume(volume)
+{
+}
+
+quint32 PaControl::cindex() const
+{
+ return m_cindex;
+}
+
+QString PaControl::desc() const
+{
+ return m_desc;
+}
+
+quint32 PaControl::type() const
+{
+ return m_type;
+}
+
+quint32 PaControl::channel() const
+{
+ return m_channel;
+}
+
+QString PaControl::cdesc() const
+{
+ return m_cdesc;
+}
+
+
+quint32 PaControl::volume() const
+{
+ return m_volume;
+}
+
+// FIXME: Not all of these should be editable roles
+void PaControl::setCIndex(const QVariant &cindex)
+{
+ m_cindex = cindex.toUInt();
+}
+
+void PaControl::setDesc(const QVariant &desc)
+{
+ m_desc = desc.toString();
+}
+
+void PaControl::setType(const QVariant &type)
+{
+ m_type = type.toUInt();
+}
+
+void PaControl::setChannel(const QVariant &channel)
+{
+ m_channel = channel.toUInt();
+}
+
+void PaControl::setCDesc(const QVariant &cdesc)
+{
+ m_cdesc = cdesc.toString();
+}
+
+void PaControl::setVolume(pa_context *pa_ctx, const QVariant &volume)
+{
+ if (volume != m_volume) {
+ m_volume = volume.toUInt();
+ pac_set_volume(pa_ctx, type(), cindex(), channel(), m_volume);
+ }
+}
+
+PaControlModel::PaControlModel(QObject *parent)
+ : QAbstractListModel(parent)
+{
+ pa_ctx = pac_init(this, "Mixer");
+}
+
+void PaControlModel::addControl(const PaControl &control)
+{
+ beginInsertRows(QModelIndex(), rowCount(), rowCount());
+ m_controls << control;
+ endInsertRows();
+}
+
+void add_one_control(void *ctx, int cindex, const char *desc, int type, int channel, const char *cdesc, int volume)
+{
+ // Get the PaControlModel object from the opaque pointer context
+ PaControlModel *pacm = static_cast<PaControlModel*>(ctx);
+ pacm->addControl(PaControl(cindex, desc, type, channel, cdesc, volume));
+}
+
+int PaControlModel::rowCount(const QModelIndex & parent) const {
+ Q_UNUSED(parent);
+ return m_controls.count();
+}
+
+bool PaControlModel::setData(const QModelIndex &index, const QVariant &value, int role) {
+ if (index.row() < 0 || index.row() >= m_controls.count())
+ return false;
+ PaControl &control = m_controls[index.row()];
+ if (role == CIndexRole)
+ control.setCIndex(value);
+ else if (role == DescRole)
+ control.setDesc(value);
+ else if (role == TypeRole)
+ control.setType(value);
+ else if (role == ChannelRole)
+ control.setChannel(value);
+ else if (role == CDescRole)
+ control.setCDesc(value);
+ else if (role == VolumeRole)
+ control.setVolume(pa_ctx, value);
+ emit dataChanged(index, index);
+ return true;
+}
+
+QVariant PaControlModel::data(const QModelIndex & index, int role) const {
+ if (index.row() < 0 || index.row() >= m_controls.count())
+ return QVariant();
+
+ const PaControl &control = m_controls[index.row()];
+ if (role == CIndexRole)
+ return control.cindex();
+ else if (role == DescRole)
+ return control.desc();
+ else if (role == TypeRole)
+ return control.type();
+ else if (role == ChannelRole)
+ return control.channel();
+ else if (role == CDescRole)
+ return control.cdesc();
+ else if (role == VolumeRole)
+ return control.volume();
+ return QVariant();
+}
+
+Qt::ItemFlags PaControlModel::flags(const QModelIndex &index) const
+{
+ if (!index.isValid())
+ return Qt::ItemIsEnabled;
+
+ return QAbstractListModel::flags(index) | Qt::ItemIsEditable;
+}
+
+QHash<int, QByteArray> PaControlModel::roleNames() const {
+ QHash<int, QByteArray> roles;
+ roles[CIndexRole] = "cindex";
+ roles[DescRole] = "desc";
+ roles[TypeRole] = "type";
+ roles[ChannelRole] = "channel";
+ roles[CDescRole] = "cdesc";
+ roles[VolumeRole] = "volume";
+ return roles;
+}
diff --git a/app/pacontrolmodel.h b/app/pacontrolmodel.h
new file mode 100644
index 0000000..aa34a79
--- /dev/null
+++ b/app/pacontrolmodel.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2016 Konsulko Group
+ *
+ * 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.
+ */
+
+#include <pulse/pulseaudio.h>
+
+#ifndef __cplusplus
+extern void add_one_control(void *ctx, int, const char *, int, int, const char *, int);
+#else
+extern "C" void add_one_control(void *ctx, int, const char *, int, int, const char *, int);
+
+#include <QAbstractListModel>
+#include <QStringList>
+
+class PaControlModel;
+
+class PaControl
+{
+ public:
+ PaControl(const quint32 &index, const QString &desc, const quint32 &type, const quint32 &channel, const QString &cdesc, const quint32 &volume);
+
+ quint32 cindex() const;
+ QString desc() const;
+ quint32 type() const;
+ quint32 channel() const;
+ QString cdesc() const;
+ quint32 volume() const;
+ void setCIndex(const QVariant&);
+ void setDesc(const QVariant&);
+ void setType(const QVariant&);
+ void setChannel(const QVariant&);
+ void setCDesc(const QVariant&);
+ void setVolume(pa_context *, const QVariant&);
+
+ private:
+ quint32 m_cindex;
+ QString m_desc;
+ quint32 m_type;
+ quint32 m_channel;
+ QString m_cdesc;
+ quint32 m_volume;
+};
+
+class PaControlModel : public QAbstractListModel
+{
+ Q_OBJECT
+ public:
+ enum PaControlRoles {
+ CIndexRole = Qt::UserRole + 1,
+ DescRole,
+ TypeRole,
+ ChannelRole,
+ CDescRole,
+ VolumeRole
+ };
+
+ PaControlModel(QObject *parent = 0);
+
+ void addControl(const PaControl &control);
+
+ int rowCount(const QModelIndex &parent = QModelIndex()) const;
+
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+
+ bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
+
+ Qt::ItemFlags flags(const QModelIndex &index) const;
+
+ protected:
+ QHash<int, QByteArray> roleNames() const;
+ private:
+ QList<PaControl> m_controls;
+ pa_context *pa_ctx;
+};
+#endif // __cplusplus
diff --git a/mixer.pro b/mixer.pro
new file mode 100644
index 0000000..579a952
--- /dev/null
+++ b/mixer.pro
@@ -0,0 +1,3 @@
+TEMPLATE = subdirs
+SUBDIRS = app package
+package.depends += app
diff --git a/package/config.xml b/package/config.xml
new file mode 100644
index 0000000..ec9eb22
--- /dev/null
+++ b/package/config.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<widget xmlns="http://www.w3.org/ns/widgets" id="mixer" version="0.1">
+ <name>MediaPlayer</name>
+ <icon src="icon.svg"/>
+ <content src="bin/mixer" type="application/x-executable"/>
+ <description>Simple PulseAudio mixer app</description>
+ <author>Matt Porter &lt;mporter@konsulko.com&gt;</author>
+ <license>APL 2.0</license>
+</widget>
+
+
diff --git a/package/icon.svg b/package/icon.svg
new file mode 100644
index 0000000..85f7384
--- /dev/null
+++ b/package/icon.svg
@@ -0,0 +1,439 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ x="0px"
+ y="0px"
+ viewBox="0 0 320 320"
+ style="enable-background:new 0 0 320 320;"
+ xml:space="preserve"
+ id="svg2"
+ inkscape:version="0.91 r13725"
+ sodipodi:docname="mixer.svg"><metadata
+ id="metadata1292"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
+ id="defs1290"><linearGradient
+ y2="-133.5267"
+ x2="256.38519"
+ y1="254.18359"
+ x1="115.9317"
+ gradientUnits="userSpaceOnUse"
+ id="SVGID_91_"><stop
+ id="stop887"
+ style="stop-color:#8BC53F"
+ offset="0" /><stop
+ id="stop889"
+ style="stop-color:#7CCB56;stop-opacity:0.9678"
+ offset="2.015080e-02" /><stop
+ id="stop891"
+ style="stop-color:#62D67D;stop-opacity:0.9028"
+ offset="6.089833e-02" /><stop
+ id="stop893"
+ style="stop-color:#4BDFA0;stop-opacity:0.8312"
+ offset="0.1057" /><stop
+ id="stop895"
+ style="stop-color:#38E7BE;stop-opacity:0.7537"
+ offset="0.1543" /><stop
+ id="stop897"
+ style="stop-color:#28EED6;stop-opacity:0.6684"
+ offset="0.2077" /><stop
+ id="stop899"
+ style="stop-color:#1CF3E8;stop-opacity:0.572"
+ offset="0.2681" /><stop
+ id="stop901"
+ style="stop-color:#13F6F5;stop-opacity:0.4581"
+ offset="0.3394" /><stop
+ id="stop903"
+ style="stop-color:#0EF8FD;stop-opacity:0.3098"
+ offset="0.4323" /><stop
+ id="stop905"
+ style="stop-color:#0DF9FF;stop-opacity:0"
+ offset="0.6264" /></linearGradient><linearGradient
+ gradientTransform="matrix(1,0.00546456,-0.00546456,1,-2.0192,-3.0212)"
+ y2="-15.4029"
+ x2="320.4859"
+ y1="287.94919"
+ x1="4.0481"
+ gradientUnits="userSpaceOnUse"
+ id="SVGID_92_"><stop
+ id="stop910"
+ style="stop-color:#59FF7F"
+ offset="0" /><stop
+ id="stop912"
+ style="stop-color:#6BFBFF"
+ offset="1" /></linearGradient><linearGradient
+ id="SVGID_93_"
+ gradientUnits="userSpaceOnUse"
+ x1="140.54449"
+ y1="202.2363"
+ x2="186.84441"
+ y2="68.704903"><stop
+ offset="0"
+ style="stop-color:#59FF7F"
+ id="stop921" /><stop
+ offset="1"
+ style="stop-color:#6BFBFF"
+ id="stop923" /></linearGradient><linearGradient
+ id="SVGID_94_"
+ gradientUnits="userSpaceOnUse"
+ x1="145.3286"
+ y1="203.8951"
+ x2="191.62849"
+ y2="70.363701"><stop
+ offset="0"
+ style="stop-color:#59FF7F"
+ id="stop928" /><stop
+ offset="1"
+ style="stop-color:#6BFBFF"
+ id="stop930" /></linearGradient><linearGradient
+ inkscape:collect="always"
+ xlink:href="#SVGID_93_-3"
+ id="linearGradient4842"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.1581339,0,0,1,141.23137,164.38048)"
+ x1="14.498512"
+ y1="-87.290771"
+ x2="14.498512"
+ y2="27.70923" /><linearGradient
+ id="SVGID_93_-3"
+ gradientUnits="userSpaceOnUse"
+ x1="140.54449"
+ y1="202.2363"
+ x2="186.84441"
+ y2="68.704903"
+ gradientTransform="translate(-143.56916,1.357882)"><stop
+ offset="0"
+ style="stop-color:#59FF7F"
+ id="stop921-6" /><stop
+ offset="1"
+ style="stop-color:#6BFBFF"
+ id="stop923-7" /></linearGradient><linearGradient
+ inkscape:collect="always"
+ xlink:href="#SVGID_93_-3"
+ id="linearGradient4844"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.1581339,0,0,1,141.23137,164.38048)"
+ x1="-21.109684"
+ y1="-29.642464"
+ x2="50.744526"
+ y2="-29.642464" /><linearGradient
+ inkscape:collect="always"
+ xlink:href="#SVGID_93_-3"
+ id="linearGradient5671"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.1581339,0,0,1,141.23137,164.38048)"
+ x1="14.498512"
+ y1="-87.290771"
+ x2="14.498512"
+ y2="27.70923" /><linearGradient
+ inkscape:collect="always"
+ xlink:href="#SVGID_93_-3"
+ id="linearGradient5673"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.1581339,0,0,1,141.23137,164.38048)"
+ x1="-21.109684"
+ y1="-29.642464"
+ x2="50.744526"
+ y2="-29.642464" /><linearGradient
+ inkscape:collect="always"
+ xlink:href="#SVGID_93_-3"
+ id="linearGradient5675"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.1581339,0,0,1,141.23137,164.38048)"
+ x1="-21.109684"
+ y1="-29.642464"
+ x2="50.744526"
+ y2="-29.642464" /><linearGradient
+ inkscape:collect="always"
+ xlink:href="#SVGID_93_-3"
+ id="linearGradient5677"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.1581339,0,0,1,141.23137,164.38048)"
+ x1="-21.109684"
+ y1="-29.642464"
+ x2="50.744526"
+ y2="-29.642464" /><linearGradient
+ inkscape:collect="always"
+ xlink:href="#SVGID_93_-3"
+ id="linearGradient5679"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.1581339,0,0,1,141.23137,164.38048)"
+ x1="-21.109684"
+ y1="-29.642464"
+ x2="50.744526"
+ y2="-29.642464" /><linearGradient
+ inkscape:collect="always"
+ xlink:href="#SVGID_93_-3"
+ id="linearGradient5681"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.1581339,0,0,1,141.23137,164.38048)"
+ x1="-21.109684"
+ y1="-29.642464"
+ x2="50.744526"
+ y2="-29.642464" /><linearGradient
+ inkscape:collect="always"
+ xlink:href="#SVGID_93_-3"
+ id="linearGradient4191"
+ x1="116.82286"
+ y1="115.31003"
+ x2="139.46107"
+ y2="115.31003"
+ gradientUnits="userSpaceOnUse" /><linearGradient
+ inkscape:collect="always"
+ xlink:href="#SVGID_93_-3"
+ id="linearGradient4199"
+ x1="136.32275"
+ y1="171.31003"
+ x2="158.96097"
+ y2="171.31003"
+ gradientUnits="userSpaceOnUse" /><linearGradient
+ inkscape:collect="always"
+ xlink:href="#SVGID_93_-3"
+ id="linearGradient4207"
+ x1="156.32275"
+ y1="89.810028"
+ x2="178.96097"
+ y2="89.810028"
+ gradientUnits="userSpaceOnUse" /><linearGradient
+ inkscape:collect="always"
+ xlink:href="#SVGID_93_-3"
+ id="linearGradient4215"
+ x1="177.32275"
+ y1="138.31003"
+ x2="199.96097"
+ y2="138.31003"
+ gradientUnits="userSpaceOnUse" /></defs><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="2560"
+ inkscape:window-height="1440"
+ id="namedview1288"
+ showgrid="false"
+ inkscape:zoom="1.4142136"
+ inkscape:cx="-46.791657"
+ inkscape:cy="160"
+ inkscape:window-x="2560"
+ inkscape:window-y="0"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="svg2" /><style
+ type="text/css"
+ id="style4">
+ .st0{display:none;}
+ .st1{display:inline;}
+ .st2{opacity:0.4;fill:url(#SVGID_1_);}
+ .st3{fill:url(#SVGID_2_);}
+ .st4{fill:#FFFFFF;}
+ .st5{font-family:'Roboto-Regular';}
+ .st6{font-size:25px;}
+ .st7{letter-spacing:6;}
+ .st8{fill:url(#SVGID_3_);}
+ .st9{fill:url(#SVGID_4_);}
+ .st10{fill:url(#SVGID_5_);}
+ .st11{fill:url(#SVGID_6_);}
+ .st12{fill:url(#SVGID_7_);}
+ .st13{fill:url(#SVGID_8_);}
+ .st14{fill:url(#SVGID_9_);}
+ .st15{fill:url(#SVGID_10_);}
+ .st16{fill:url(#SVGID_11_);}
+ .st17{fill:url(#SVGID_12_);}
+ .st18{fill:url(#SVGID_13_);}
+ .st19{fill:url(#SVGID_14_);}
+ .st20{fill:url(#SVGID_15_);}
+ .st21{fill:url(#SVGID_16_);}
+ .st22{fill:url(#SVGID_17_);}
+ .st23{fill:url(#SVGID_18_);}
+ .st24{opacity:0.29;}
+ .st25{fill:url(#SVGID_19_);}
+ .st26{fill:url(#SVGID_20_);}
+ .st27{fill:url(#SVGID_21_);}
+ .st28{fill:url(#SVGID_22_);}
+ .st29{fill:url(#SVGID_23_);}
+ .st30{fill:url(#SVGID_24_);}
+ .st31{fill:url(#SVGID_25_);}
+ .st32{fill:url(#SVGID_26_);}
+ .st33{fill:url(#SVGID_27_);}
+ .st34{fill:url(#SVGID_28_);}
+ .st35{fill:url(#SVGID_29_);}
+ .st36{fill:url(#SVGID_30_);}
+ .st37{fill:url(#SVGID_31_);}
+ .st38{fill:url(#SVGID_32_);}
+ .st39{fill:url(#SVGID_33_);}
+ .st40{fill:url(#SVGID_34_);}
+ .st41{fill:url(#SVGID_35_);}
+ .st42{fill:url(#SVGID_36_);}
+ .st43{opacity:0.4;fill:url(#SVGID_37_);}
+ .st44{fill:url(#SVGID_38_);}
+ .st45{fill:url(#SVGID_39_);}
+ .st46{fill:url(#SVGID_40_);}
+ .st47{fill:url(#SVGID_41_);}
+ .st48{fill:url(#SVGID_42_);}
+ .st49{fill:url(#SVGID_43_);}
+ .st50{fill:url(#SVGID_44_);}
+ .st51{display:inline;opacity:0.29;}
+ .st52{display:inline;fill:url(#SVGID_45_);}
+ .st53{display:inline;fill:url(#SVGID_46_);}
+ .st54{display:inline;fill:#FFFFFF;}
+ .st55{display:inline;fill:url(#SVGID_47_);}
+ .st56{display:inline;fill:url(#SVGID_48_);}
+ .st57{display:inline;fill:url(#SVGID_49_);}
+ .st58{display:inline;fill:url(#SVGID_50_);}
+ .st59{display:inline;fill:url(#SVGID_51_);}
+ .st60{display:inline;fill:url(#SVGID_52_);}
+ .st61{opacity:0.4;fill:url(#SVGID_53_);}
+ .st62{fill:url(#SVGID_54_);}
+ .st63{fill:url(#SVGID_55_);}
+ .st64{fill:url(#SVGID_56_);}
+ .st65{fill:url(#SVGID_57_);}
+ .st66{fill:url(#SVGID_58_);}
+ .st67{opacity:0.4;fill:url(#SVGID_59_);}
+ .st68{fill:url(#SVGID_60_);}
+ .st69{fill:url(#SVGID_61_);}
+ .st70{fill:url(#SVGID_62_);}
+ .st71{fill:url(#SVGID_63_);}
+ .st72{fill:url(#SVGID_64_);}
+ .st73{fill:url(#SVGID_65_);}
+ .st74{fill:url(#SVGID_66_);}
+ .st75{fill:url(#SVGID_67_);}
+ .st76{fill:url(#SVGID_68_);}
+ .st77{fill:url(#SVGID_69_);}
+ .st78{fill:url(#SVGID_70_);}
+ .st79{fill:url(#SVGID_71_);}
+ .st80{fill:url(#SVGID_72_);}
+ .st81{fill:url(#SVGID_73_);}
+ .st82{fill:url(#SVGID_74_);}
+ .st83{fill:url(#SVGID_75_);}
+ .st84{fill:url(#SVGID_76_);}
+ .st85{fill:url(#SVGID_77_);}
+ .st86{fill:url(#SVGID_78_);}
+ .st87{fill:url(#SVGID_79_);}
+ .st88{fill:url(#SVGID_80_);}
+ .st89{fill:url(#SVGID_81_);}
+ .st90{fill:url(#SVGID_82_);}
+ .st91{fill:url(#SVGID_83_);}
+ .st92{fill:url(#SVGID_84_);}
+ .st93{fill:url(#SVGID_85_);}
+ .st94{fill:url(#SVGID_86_);}
+ .st95{opacity:0.4;fill:url(#SVGID_87_);}
+ .st96{fill:url(#SVGID_88_);}
+ .st97{fill:url(#SVGID_89_);}
+ .st98{fill:url(#SVGID_90_);}
+ .st99{fill:url(#SVGID_91_);}
+ .st100{fill:url(#SVGID_92_);}
+ .st101{fill:url(#SVGID_93_);}
+ .st102{fill:url(#SVGID_94_);}
+ .st103{opacity:0.4;fill:url(#SVGID_95_);}
+ .st104{fill:url(#SVGID_96_);}
+ .st105{fill:url(#SVGID_97_);}
+ .st106{fill:url(#SVGID_98_);}
+ .st107{fill:url(#SVGID_99_);}
+ .st108{fill:url(#SVGID_100_);}
+ .st109{fill:url(#SVGID_101_);}
+ .st110{display:inline;fill:url(#SVGID_102_);}
+ .st111{display:inline;fill:url(#SVGID_103_);}
+ .st112{fill:url(#SVGID_104_);}
+ .st113{fill:url(#SVGID_105_);}
+ .st114{fill:url(#SVGID_106_);}
+ .st115{fill:url(#SVGID_107_);}
+ .st116{fill:url(#SVGID_108_);}
+ .st117{opacity:0.4;fill:url(#SVGID_109_);}
+ .st118{fill:url(#SVGID_110_);}
+ .st119{fill:url(#SVGID_111_);}
+ .st120{fill:url(#SVGID_112_);}
+ .st121{fill:url(#SVGID_113_);}
+ .st122{fill:url(#SVGID_114_);}
+ .st123{opacity:0.4;fill:url(#SVGID_115_);}
+ .st124{fill:url(#SVGID_116_);}
+ .st125{fill:url(#SVGID_117_);}
+ .st126{fill:url(#SVGID_118_);}
+ .st127{display:inline;fill:url(#SVGID_119_);}
+ .st128{display:inline;fill:url(#SVGID_120_);}
+ .st129{fill:url(#SVGID_121_);}
+ .st130{fill:url(#SVGID_122_);}
+</style><circle
+ style="opacity:0.28999999"
+ id="circle884"
+ r="101.9"
+ cy="133.39999"
+ cx="159.7"
+ class="st24" /><circle
+ style="fill:url(#SVGID_91_)"
+ id="circle907"
+ r="101.9"
+ cy="133.39999"
+ cx="159.7"
+ class="st99" /><path
+ inkscape:connector-curvature="0"
+ style="fill:url(#SVGID_92_)"
+ id="path914"
+ d="m 160,238.8 c -0.2,0 -0.4,0 -0.6,0 C 101.4,238.5 54.5,191.1 54.8,133.1 55.2,75.3 102.3,28.5 160,28.5 c 0.2,0 0.4,0 0.6,0 58,0.3 104.9,47.7 104.6,105.7 l 0,0 C 264.8,192 217.7,238.8 160,238.8 Z m 0,-206.6 c -55.7,0 -101.2,45.2 -101.5,100.9 -0.3,55.9 45,101.7 100.9,102 0.2,0 0.4,0 0.6,0 55.7,0 101.2,-45.2 101.5,-100.9 0.3,-55.9 -45,-101.7 -100.9,-102 -0.2,0 -0.4,0 -0.6,0 z"
+ class="st100" /><text
+ class="st4 st5 st6 st7"
+ id="text918"
+ style="font-size:25px;font-family:Roboto-Regular;letter-spacing:6;fill:#ffffff"
+ x="88.23233"
+ y="284.00482">MMIXERA</text>
+<rect
+ y="77.327003"
+ x="123.12096"
+ height="115.32204"
+ width="10.851755"
+ id="rect3447-2"
+ style="fill:url(#linearGradient5671);fill-opacity:1" /><rect
+ y="107.83031"
+ x="117.33897"
+ height="14.959444"
+ width="21.606014"
+ id="rect3443"
+ style="fill:url(#linearGradient5673);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient4191);stroke-width:1.03220296px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /><rect
+ y="77.327003"
+ x="183.62096"
+ height="115.32204"
+ width="10.851755"
+ id="rect3447-2-0"
+ style="fill:url(#linearGradient5675);fill-opacity:1" /><rect
+ y="76.827003"
+ x="142.62096"
+ height="115.32204"
+ width="10.851755"
+ id="rect3447-2-6"
+ style="fill:url(#linearGradient4842);fill-opacity:1" /><rect
+ y="77.327003"
+ x="163.12096"
+ height="115.32204"
+ width="10.851755"
+ id="rect3447-2-2"
+ style="fill:url(#linearGradient5677);fill-opacity:1" /><rect
+ y="163.83031"
+ x="136.83885"
+ height="14.959444"
+ width="21.606014"
+ id="rect3443-6"
+ style="fill:url(#linearGradient5679);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient4199);stroke-width:1.03220296px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /><rect
+ y="82.330307"
+ x="156.83885"
+ height="14.959444"
+ width="21.606014"
+ id="rect3443-6-1"
+ style="fill:url(#linearGradient5681);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient4207);stroke-width:1.03220296px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /><rect
+ y="130.83031"
+ x="177.83885"
+ height="14.959444"
+ width="21.606014"
+ id="rect3443-6-1-8"
+ style="fill:url(#linearGradient4844);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient4215);stroke-width:1.03220296px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /></svg> \ No newline at end of file
diff --git a/package/package.pro b/package/package.pro
new file mode 100644
index 0000000..3d37bd7
--- /dev/null
+++ b/package/package.pro
@@ -0,0 +1,19 @@
+
+DISTFILES = icon.svg config.xml
+
+copy_icon.target = $$OUT_PWD/root/icon.svg
+copy_icon.depends = $$_PRO_FILE_PWD_/icon.svg
+copy_icon.commands = $(COPY_FILE) \"$$replace(copy_icon.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_icon.target, /, $$QMAKE_DIR_SEP)\"
+QMAKE_EXTRA_TARGETS += copy_icon
+PRE_TARGETDEPS += $$copy_icon.target
+
+copy_config.target = $$OUT_PWD/root/config.xml
+copy_config.depends = $$_PRO_FILE_PWD_/config.xml
+copy_config.commands = $(COPY_FILE) \"$$replace(copy_config.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_config.target, /, $$QMAKE_DIR_SEP)\"
+QMAKE_EXTRA_TARGETS += copy_config
+PRE_TARGETDEPS += $$copy_config.target
+
+wgt.target = package
+wgt.commands = wgtpkg-pack -f -o mixer.wgt root
+
+QMAKE_EXTRA_TARGETS += wgt