[gnome-flashback] audio-selection: initial version



commit 57eca000a228b51a2e4270371ac2e6878027e14d
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Thu Feb 18 13:08:42 2016 +0200

    audio-selection: initial version

 configure.ac                                       |    6 +++
 data/schemas/org.gnome.gnome-flashback.gschema.xml |    6 +++
 gnome-flashback/Makefile.am                        |    2 +
 gnome-flashback/gf-application.c                   |    4 ++
 gnome-flashback/libaudio-selection/Makefile.am     |   31 ++++++++++++++
 .../libaudio-selection/gf-audio-selection.c        |   43 ++++++++++++++++++++
 .../libaudio-selection/gf-audio-selection.h        |   33 +++++++++++++++
 7 files changed, 125 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 533be39..fbc04bb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -119,6 +119,11 @@ PKG_CHECK_MODULES([GNOME_FLASHBACK], [
   gtk+-3.0 >= $GTK_REQUIRED
 ])
 
+PKG_CHECK_MODULES([AUDIO_SELECTION], [
+  gtk+-3.0 >= $GTK_REQUIRED
+  glib-2.0 >= $GLIB_REQUIRED
+])
+
 PKG_CHECK_MODULES([AUTOMOUNT_MANAGER], [
   gtk+-3.0 >= $GTK_REQUIRED
   gsettings-desktop-schemas >= $GSETTINGS_DESKTOP_SCHEMAS_REQUIRED
@@ -278,6 +283,7 @@ AC_CONFIG_FILES([
   data/xsessions/Makefile
 
   gnome-flashback/Makefile
+  gnome-flashback/libaudio-selection/Makefile
   gnome-flashback/libautomount-manager/Makefile
   gnome-flashback/libbluetooth-applet/Makefile
   gnome-flashback/libcommon/Makefile
diff --git a/data/schemas/org.gnome.gnome-flashback.gschema.xml 
b/data/schemas/org.gnome.gnome-flashback.gschema.xml
index d93009d..486599f 100644
--- a/data/schemas/org.gnome.gnome-flashback.gschema.xml
+++ b/data/schemas/org.gnome.gnome-flashback.gschema.xml
@@ -1,6 +1,12 @@
 <schemalist gettext-domain="gnome-flashback">
   <schema id="org.gnome.gnome-flashback" path="/org/gnome/gnome-flashback/">
 
+    <key name="audio-selection" type="b">
+      <default>true</default>
+      <summary>Audio device selection</summary>
+      <description>If set to true, then GNOME Flashback application will be used to provide audo device 
selection dialog.</description>
+    </key>
+
     <key name="automount-manager" type="b">
       <default>true</default>
       <summary>Automount manager</summary>
diff --git a/gnome-flashback/Makefile.am b/gnome-flashback/Makefile.am
index 9f5d69e..fdd632c 100644
--- a/gnome-flashback/Makefile.am
+++ b/gnome-flashback/Makefile.am
@@ -1,6 +1,7 @@
 NULL =
 
 SUBDIRS = \
+       libaudio-selection \
        libautomount-manager \
        libbluetooth-applet \
        libcommon \
@@ -52,6 +53,7 @@ gnome_flashback_LDFLAGS = \
 
 gnome_flashback_LDADD = \
        $(GNOME_FLASHBACK_LIBS) \
+       $(top_builddir)/gnome-flashback/libaudio-selection/libaudio-selection.la \
        $(top_builddir)/gnome-flashback/libautomount-manager/libautomount-manager.la \
        $(top_builddir)/gnome-flashback/libbluetooth-applet/libbluetooth-applet.la \
        $(top_builddir)/gnome-flashback/libdesktop-background/libdesktop-background.la \
diff --git a/gnome-flashback/gf-application.c b/gnome-flashback/gf-application.c
index 05e2d69..f204e6c 100644
--- a/gnome-flashback/gf-application.c
+++ b/gnome-flashback/gf-application.c
@@ -21,6 +21,7 @@
 #include <gtk/gtk.h>
 
 #include "gf-application.h"
+#include "libaudio-selection/gf-audio-selection.h"
 #include "libautomount-manager/gsd-automount-manager.h"
 #include "libbluetooth-applet/gf-bluetooth-applet.h"
 #include "libdesktop-background/gf-desktop-background.h"
@@ -57,6 +58,7 @@ struct _GfApplication
   FlashbackIdleMonitor   *idle_monitor;
   FlashbackPolkit        *polkit;
   FlashbackShell         *shell;
+  GfAudioSelection       *audio_selection;
   GfBluetoothApplet      *bluetooth;
   GfDesktopBackground    *background;
   GfEndSessionDialog     *dialog;
@@ -154,6 +156,7 @@ settings_changed (GSettings   *settings,
   SETTING_CHANGED (idle_monitor, "idle-monitor", flashback_idle_monitor_new)
   SETTING_CHANGED (polkit, "polkit", flashback_polkit_new)
   SETTING_CHANGED (shell, "shell", flashback_shell_new)
+  SETTING_CHANGED (audio_selection, "audio-selection", gf_audio_selection_new)
   SETTING_CHANGED (bluetooth, "bluetooth-applet", gf_bluetooth_applet_new)
   SETTING_CHANGED (background, "desktop-background", gf_desktop_background_new)
   SETTING_CHANGED (dialog, "end-session-dialog", gf_end_session_dialog_new)
@@ -198,6 +201,7 @@ gf_application_dispose (GObject *object)
   g_clear_object (&application->idle_monitor);
   g_clear_object (&application->polkit);
   g_clear_object (&application->shell);
+  g_clear_object (&application->audio_selection);
   g_clear_object (&application->bluetooth);
   g_clear_object (&application->background);
   g_clear_object (&application->dialog);
diff --git a/gnome-flashback/libaudio-selection/Makefile.am b/gnome-flashback/libaudio-selection/Makefile.am
new file mode 100644
index 0000000..7b76e79
--- /dev/null
+++ b/gnome-flashback/libaudio-selection/Makefile.am
@@ -0,0 +1,31 @@
+NULL =
+
+noinst_LTLIBRARIES = \
+       libaudio-selection.la \
+       $(NULL)
+
+libaudio_selection_la_CPPFLAGS = \
+       -I$(top_builddir)/gnome-flashback/libaudio-selection \
+       $(NULL)
+
+libaudio_selection_la_CFLAGS = \
+       $(AUDIO_SELECTION_CFLAGS) \
+       $(WARN_CFLAGS) \
+       $(AM_CFLAGS) \
+       $(NULL)
+
+libaudio_selection_la_SOURCES = \
+       gf-audio-selection.c \
+       gf-audio-selection.h \
+       $(NULL)
+
+libaudio_selection_la_LDFLAGS = \
+       $(WARN_LDFLAGS) \
+       $(AM_LDFLAGS) \
+       $(NULL)
+
+libaudio_selection_la_LIBADD = \
+       $(AUDIO_SELECTION_LIBS) \
+       $(NULL)
+
+-include $(top_srcdir)/git.mk
diff --git a/gnome-flashback/libaudio-selection/gf-audio-selection.c 
b/gnome-flashback/libaudio-selection/gf-audio-selection.c
new file mode 100644
index 0000000..e02ad76
--- /dev/null
+++ b/gnome-flashback/libaudio-selection/gf-audio-selection.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2016 Alberts Muktupāvels
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include "gf-audio-selection.h"
+
+struct _GfAudioSelection
+{
+  GObject parent;
+};
+
+G_DEFINE_TYPE (GfAudioSelection, gf_audio_selection, G_TYPE_OBJECT)
+
+static void
+gf_audio_selection_class_init (GfAudioSelectionClass *audio_selection_class)
+{
+}
+
+static void
+gf_audio_selection_init (GfAudioSelection *audio_selection)
+{
+}
+
+GfAudioSelection *
+gf_audio_selection_new (void)
+{
+  return g_object_new (GF_TYPE_AUDIO_SELECTION, NULL);
+}
diff --git a/gnome-flashback/libaudio-selection/gf-audio-selection.h 
b/gnome-flashback/libaudio-selection/gf-audio-selection.h
new file mode 100644
index 0000000..8a55cfe
--- /dev/null
+++ b/gnome-flashback/libaudio-selection/gf-audio-selection.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2016 Alberts Muktupāvels
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GF_AUDIO_SELECTION_H
+#define GF_AUDIO_SELECTION_H
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define GF_TYPE_AUDIO_SELECTION gf_audio_selection_get_type ()
+G_DECLARE_FINAL_TYPE (GfAudioSelection, gf_audio_selection,
+                      GF, AUDIO_SELECTION, GObject)
+
+GfAudioSelection *gf_audio_selection_new (void);
+
+G_END_DECLS
+
+#endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]