[libdmapsharing] Fix up dmap.h and dmap-utils.h
- From: W. Michael Petullo <wmpetullo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdmapsharing] Fix up dmap.h and dmap-utils.h
- Date: Fri, 5 Jul 2013 14:53:40 +0000 (UTC)
commit 9a07b2301a1be2ff45b2366450280543ece5dcf4
Author: W. Michael Petullo <mike flyn org>
Date: Fri Jul 5 09:53:34 2013 -0500
Fix up dmap.h and dmap-utils.h
Signed-off-by: W. Michael Petullo <mike flyn org>
libdmapsharing/dmap-utils.c | 38 ++++++++++++++++++++++++++++++++++++++
libdmapsharing/dmap-utils.h | 29 +++++++++++++++++++++++++++++
libdmapsharing/dmap.h | 1 +
3 files changed, 68 insertions(+), 0 deletions(-)
---
diff --git a/libdmapsharing/dmap-utils.c b/libdmapsharing/dmap-utils.c
new file mode 100644
index 0000000..67743f1
--- /dev/null
+++ b/libdmapsharing/dmap-utils.c
@@ -0,0 +1,38 @@
+/*
+ * Utility functions used throughout libdmapsharing
+ *
+ * Copyright (C) 2010 W. Michael Petullo <mike flyn 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 St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <string.h>
+
+#include "dmap-utils.h"
+
+gchar *
+dmap_mime_to_format (const gchar * transcode_mimetype)
+{
+ if (!transcode_mimetype) {
+ return NULL;
+ } else if (!strcmp (transcode_mimetype, "audio/wav")) {
+ return g_strdup ("wav");
+ } else if (!strcmp (transcode_mimetype, "audio/mp3")) {
+ return g_strdup ("mp3");
+ } else if (!strcmp (transcode_mimetype, "video/quicktime")) {
+ return g_strdup ("mp4");
+ } else
+ return NULL;
+}
diff --git a/libdmapsharing/dmap-utils.h b/libdmapsharing/dmap-utils.h
new file mode 100644
index 0000000..1b32505
--- /dev/null
+++ b/libdmapsharing/dmap-utils.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2006 INDT
+ * Andre Moreira Magalhaes <andre magalhaes indt org br>
+ *
+ * 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 St, Fifth Floor, Boston, MA 02110-1301 USA*
+ */
+
+#ifndef __DMAP_UTILS_H__
+#define __DMAP_UTILS_H__
+
+#include <glib.h>
+#include <libsoup/soup.h>
+
+gchar * dmap_mime_to_format (const gchar * transcode_mimetype);
+
+G_END_DECLS
+#endif
diff --git a/libdmapsharing/dmap.h b/libdmapsharing/dmap.h
index be9179a..905e7a8 100644
--- a/libdmapsharing/dmap.h
+++ b/libdmapsharing/dmap.h
@@ -16,6 +16,7 @@
#include <libdmapsharing/dmap-record.h>
#include <libdmapsharing/dmap-record-factory.h>
#include <libdmapsharing/dmap-share.h>
+#include <libdmapsharing/dmap-utils.h>
#include <libdmapsharing/dpap-connection.h>
#include <libdmapsharing/dpap-record.h>
#include <libdmapsharing/dpap-share.h>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]