[rygel] gst-renderer: Put every class in separate file
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] gst-renderer: Put every class in separate file
- Date: Mon, 12 Jul 2010 13:55:30 +0000 (UTC)
commit 82fb8647cf4063d0d2d7f120b3de137fbb26b8d7
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Mon Jul 12 16:54:50 2010 +0300
gst-renderer: Put every class in separate file
src/plugins/gst-renderer/Makefile.am | 4 +-
.../gst-renderer/rygel-gst-renderer-player.vala | 25 ----------
.../rygel-gst-renderer-rendering-control.vala | 13 -----
.../gst-renderer/rygel-gst-renderer-time.vala | 49 ++++++++++++++++++++
.../gst-renderer/rygel-gst-renderer-volume.vala | 34 ++++++++++++++
5 files changed, 86 insertions(+), 39 deletions(-)
---
diff --git a/src/plugins/gst-renderer/Makefile.am b/src/plugins/gst-renderer/Makefile.am
index 3b383bf..4139c21 100644
--- a/src/plugins/gst-renderer/Makefile.am
+++ b/src/plugins/gst-renderer/Makefile.am
@@ -22,7 +22,9 @@ librygel_gst_renderer_la_SOURCES = rygel-gst-renderer-connection-manager.vala \
rygel-gst-renderer-av-transport.vala \
rygel-gst-renderer-player.vala \
rygel-gst-renderer-changelog.vala \
- rygel-gst-renderer-plugin.vala
+ rygel-gst-renderer-plugin.vala \
+ rygel-gst-renderer-volume.vala \
+ rygel-gst-renderer-time.vala
librygel_gst_renderer_la_VALAFLAGS = --vapidir=$(top_srcdir)/src/rygel \
--vapidir=$(srcdir) \
diff --git a/src/plugins/gst-renderer/rygel-gst-renderer-player.vala b/src/plugins/gst-renderer/rygel-gst-renderer-player.vala
index bb6e808..17dfcef 100644
--- a/src/plugins/gst-renderer/rygel-gst-renderer-player.vala
+++ b/src/plugins/gst-renderer/rygel-gst-renderer-player.vala
@@ -140,28 +140,3 @@ public class Rygel.GstRenderer.Player : GLib.Object {
return true;
}
}
-
-// Helper class for converting between Gstreamer time units and string
-// representations of time.
-private class Rygel.GstRenderer.Time {
- public static ClockTime from_string (string str) {
- uint64 hours, minutes, seconds;
-
- str.scanf ("%llu:%2llu:%2llu%*s", out hours, out minutes, out seconds);
-
- return (ClockTime) ((hours * 3600 + minutes * 60 + seconds) *
- Gst.SECOND);
- }
-
- public static string to_string (ClockTime time) {
- uint64 hours, minutes, seconds;
-
- hours = time / Gst.SECOND / 3600;
- seconds = time / Gst.SECOND % 3600;
- minutes = seconds / 60;
- seconds = seconds % 60;
-
- return "%llu:%.2llu:%.2llu".printf (hours, minutes, seconds);
- }
-}
-
diff --git a/src/plugins/gst-renderer/rygel-gst-renderer-rendering-control.vala b/src/plugins/gst-renderer/rygel-gst-renderer-rendering-control.vala
index 01f7719..4bafe18 100644
--- a/src/plugins/gst-renderer/rygel-gst-renderer-rendering-control.vala
+++ b/src/plugins/gst-renderer/rygel-gst-renderer-rendering-control.vala
@@ -238,16 +238,3 @@ public class Rygel.GstRenderer.RenderingControl : Service {
action.return ();
}
}
-
-// Helper class for converting between double and percentage representations
-// of volume.
-private class Rygel.GstRenderer.Volume {
- public static double from_percentage (uint percentage) {
- return (double) percentage / 100.0;
- }
-
- public static uint to_percentage (double volume) {
- return (uint) (volume * 100.0);
- }
-}
-
diff --git a/src/plugins/gst-renderer/rygel-gst-renderer-time.vala b/src/plugins/gst-renderer/rygel-gst-renderer-time.vala
new file mode 100644
index 0000000..9e2ef30
--- /dev/null
+++ b/src/plugins/gst-renderer/rygel-gst-renderer-time.vala
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2008 OpenedHand Ltd.
+ * Copyright (C) 2009 Nokia Corporation.
+ *
+ * Author: Jorn Baayen <jorn openedhand com>
+ * Zeeshan Ali (Khattak) <zeeshanak gnome org>
+ * <zeeshan ali nokia com>
+ *
+ * Rygel 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 of the License, or
+ * (at your option) any later version.
+ *
+ * Rygel 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 program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+using Gst;
+
+// Helper class for converting between Gstreamer time units and string
+// representations of time.
+private class Rygel.GstRenderer.Time {
+ public static ClockTime from_string (string str) {
+ uint64 hours, minutes, seconds;
+
+ str.scanf ("%llu:%2llu:%2llu%*s", out hours, out minutes, out seconds);
+
+ return (ClockTime) ((hours * 3600 + minutes * 60 + seconds) *
+ Gst.SECOND);
+ }
+
+ public static string to_string (ClockTime time) {
+ uint64 hours, minutes, seconds;
+
+ hours = time / Gst.SECOND / 3600;
+ seconds = time / Gst.SECOND % 3600;
+ minutes = seconds / 60;
+ seconds = seconds % 60;
+
+ return "%llu:%.2llu:%.2llu".printf (hours, minutes, seconds);
+ }
+}
+
diff --git a/src/plugins/gst-renderer/rygel-gst-renderer-volume.vala b/src/plugins/gst-renderer/rygel-gst-renderer-volume.vala
new file mode 100644
index 0000000..00a7c97
--- /dev/null
+++ b/src/plugins/gst-renderer/rygel-gst-renderer-volume.vala
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2008 OpenedHand Ltd.
+ * Copyright (C) 2009 Nokia Corporation.
+ *
+ * Author: Jorn Baayen <jorn openedhand com>
+ * Zeeshan Ali (Khattak) <zeeshanak gnome org>
+ * <zeeshan ali nokia com>
+ *
+ * Rygel 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 of the License, or
+ * (at your option) any later version.
+ *
+ * Rygel 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 program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+// Helper class for converting between double and percentage representations
+// of volume.
+private class Rygel.GstRenderer.Volume {
+ public static double from_percentage (uint percentage) {
+ return (double) percentage / 100.0;
+ }
+
+ public static uint to_percentage (double volume) {
+ return (uint) (volume * 100.0);
+ }
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]