banshee r3619 - in trunk/banshee: libbanshee src/Core/Banshee.ThickClient src/Core/Banshee.ThickClient/Banshee.Collection.Gui src/Extensions src/Libraries/Hyena.Gui



Author: abock
Date: Mon Mar 31 19:20:32 2008
New Revision: 3619
URL: http://svn.gnome.org/viewvc/banshee?rev=3619&view=rev

Log:
More libbanshee cleanup

Added:
   trunk/banshee/libbanshee/banshee-player-cdda.c
      - copied, changed from r3615, /trunk/banshee/libbanshee/banshee-player-cdda.h
Modified:
   trunk/banshee/libbanshee/Makefile.am
   trunk/banshee/libbanshee/banshee-player-cdda.h
   trunk/banshee/libbanshee/banshee-player.c
   trunk/banshee/libbanshee/libbanshee.mdp
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/PersistentColumnController.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp
   trunk/banshee/src/Extensions/Extensions.mds
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui.mdp

Modified: trunk/banshee/libbanshee/Makefile.am
==============================================================================
--- trunk/banshee/libbanshee/Makefile.am	(original)
+++ trunk/banshee/libbanshee/Makefile.am	Mon Mar 31 19:20:32 2008
@@ -13,17 +13,17 @@
 libbanshee_la_LDFLAGS = -avoid-version -module
 libbanshee_la_SOURCES =  \
 	banshee-player.c \
-	banshee-player-cdda.h \
+	banshee-player-cdda.c \
 	gst-cd-rip-0.10.c \
 	gst-misc-0.10.c \
-	gst-playback.h \
 	gst-transcode-0.10.c
 
-OLD_CODE = \
-	gst-mbtrm.h \
-	gst-mbtrm.c \
-	nautilus-burn.c \
-	misc-glue.c
+noinst_HEADERS =  \
+	banshee-player.h \
+	banshee-player-cdda.h \
+	gst-cd-rip.h \
+	gst-misc.h \
+	gst-transcode.h
 
 libbanshee_la_LIBADD = \
 	$(LIBBANSHEE_LIBS) \

Copied: trunk/banshee/libbanshee/banshee-player-cdda.c (from r3615, /trunk/banshee/libbanshee/banshee-player-cdda.h)
==============================================================================
--- /trunk/banshee/libbanshee/banshee-player-cdda.h	(original)
+++ trunk/banshee/libbanshee/banshee-player-cdda.c	Mon Mar 31 19:20:32 2008
@@ -1,5 +1,5 @@
 //
-// banshee-player-cdda.h
+// banshee-player-cdda.c
 //
 // Author:
 //   Aaron Bockover <abockover novell com>
@@ -27,6 +27,11 @@
 //
 
 #include <gst/cdda/gstcddabasesrc.h>
+#include "banshee-player-cdda.h"
+
+// ---------------------------------------------------------------------------
+// Private Functions
+// ---------------------------------------------------------------------------
 
 static GstElement *
 bp_cdda_get_cdda_source (GstElement *playbin)
@@ -50,36 +55,6 @@
     return source;
 }
 
-static void
-bp_cdda_on_notify_source (GstElement *playbin, gpointer unknown, BansheePlayer *player)
-{
-    GstElement *cdda_src = NULL;
-    
-    g_return_if_fail (IS_BANSHEE_PLAYER (player));
-    
-    if (player->cdda_device == NULL) {
-        return;
-    }
-    
-    cdda_src = bp_cdda_get_cdda_source (playbin);
-    if (cdda_src == NULL) {
-        return;
-    }
-    
-    // Technically don't need to check the class, since GstCddaBaseSrc elements will always have this
-    if (G_LIKELY (g_object_class_find_property (G_OBJECT_GET_CLASS (cdda_src), "device"))) {
-        bp_debug ("bp_cdda: setting device property on source (%s)", player->cdda_device);
-        g_object_set (cdda_src, "device", player->cdda_device, NULL);
-    }
-    
-    // If the GstCddaBaseSrc is cdparanoia, it will have this property, so set it
-    if (g_object_class_find_property (G_OBJECT_GET_CLASS (cdda_src), "paranoia-mode")) {
-        g_object_set (cdda_src, "paranoia-mode", 0, NULL);
-    }
-    
-    g_object_unref (cdda_src);
-}
-
 static gboolean
 bp_cdda_source_seek_to_track (GstElement *playbin, guint track)
 {
@@ -116,8 +91,42 @@
     return FALSE;
 }
 
-static gboolean
-bp_cdda_handle_uri (BansheePlayer *player, const gchar *uri)
+// ---------------------------------------------------------------------------
+// Internal Functions
+// ---------------------------------------------------------------------------
+
+void
+_bp_cdda_on_notify_source (GstElement *playbin, gpointer unknown, BansheePlayer *player)
+{
+    GstElement *cdda_src = NULL;
+    
+    g_return_if_fail (IS_BANSHEE_PLAYER (player));
+    
+    if (player->cdda_device == NULL) {
+        return;
+    }
+    
+    cdda_src = bp_cdda_get_cdda_source (playbin);
+    if (cdda_src == NULL) {
+        return;
+    }
+    
+    // Technically don't need to check the class, since GstCddaBaseSrc elements will always have this
+    if (G_LIKELY (g_object_class_find_property (G_OBJECT_GET_CLASS (cdda_src), "device"))) {
+        bp_debug ("bp_cdda: setting device property on source (%s)", player->cdda_device);
+        g_object_set (cdda_src, "device", player->cdda_device, NULL);
+    }
+    
+    // If the GstCddaBaseSrc is cdparanoia, it will have this property, so set it
+    if (g_object_class_find_property (G_OBJECT_GET_CLASS (cdda_src), "paranoia-mode")) {
+        g_object_set (cdda_src, "paranoia-mode", 0, NULL);
+    }
+    
+    g_object_unref (cdda_src);
+}
+
+gboolean
+_bp_cdda_handle_uri (BansheePlayer *player, const gchar *uri)
 {
     // Processes URIs like cdda://<track-number>#<device-node> and overrides
     // track transitioning through playbin if playback was already happening

Modified: trunk/banshee/libbanshee/banshee-player-cdda.h
==============================================================================
--- trunk/banshee/libbanshee/banshee-player-cdda.h	(original)
+++ trunk/banshee/libbanshee/banshee-player-cdda.h	Mon Mar 31 19:20:32 2008
@@ -26,157 +26,12 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#include <gst/cdda/gstcddabasesrc.h>
+#ifndef _BANSHEE_PLAYER_CDDA_H
+#define _BANSHEE_PLAYER_CDDA_H
 
-static GstElement *
-bp_cdda_get_cdda_source (GstElement *playbin)
-{
-    GstElement *source = NULL;
-    
-    if (playbin == NULL) {
-        return NULL;
-    }
-    
-    g_object_get (playbin, "source", &source, NULL);
-    
-    if (source == NULL || !GST_IS_CDDA_BASE_SRC (source)) {
-        if (source != NULL) {
-            g_object_unref (source);
-        }
-        
-        return NULL;
-    }
-    
-    return source;
-}
+#include "banshee-player.h"
 
-static void
-bp_cdda_on_notify_source (GstElement *playbin, gpointer unknown, BansheePlayer *player)
-{
-    GstElement *cdda_src = NULL;
-    
-    g_return_if_fail (IS_BANSHEE_PLAYER (player));
-    
-    if (player->cdda_device == NULL) {
-        return;
-    }
-    
-    cdda_src = bp_cdda_get_cdda_source (playbin);
-    if (cdda_src == NULL) {
-        return;
-    }
-    
-    // Technically don't need to check the class, since GstCddaBaseSrc elements will always have this
-    if (G_LIKELY (g_object_class_find_property (G_OBJECT_GET_CLASS (cdda_src), "device"))) {
-        bp_debug ("bp_cdda: setting device property on source (%s)", player->cdda_device);
-        g_object_set (cdda_src, "device", player->cdda_device, NULL);
-    }
-    
-    // If the GstCddaBaseSrc is cdparanoia, it will have this property, so set it
-    if (g_object_class_find_property (G_OBJECT_GET_CLASS (cdda_src), "paranoia-mode")) {
-        g_object_set (cdda_src, "paranoia-mode", 0, NULL);
-    }
-    
-    g_object_unref (cdda_src);
-}
+void      _bp_cdda_on_notify_source  (GstElement *playbin, gpointer unknown, BansheePlayer *player);
+gboolean  _bp_cdda_handle_uri        (BansheePlayer *player, const gchar *uri);
 
-static gboolean
-bp_cdda_source_seek_to_track (GstElement *playbin, guint track)
-{
-    static GstFormat format = GST_FORMAT_UNDEFINED;
-    GstElement *cdda_src = NULL;
-    GstState state;
-    
-    format = gst_format_get_by_nick ("track");
-    if (G_UNLIKELY (format == GST_FORMAT_UNDEFINED)) {
-        return FALSE;
-    }
-    
-    gst_element_get_state (playbin, &state, NULL, 0);
-    if (state < GST_STATE_PAUSED) {
-        // We can only seek if the pipeline is playing or paused, otherwise
-        // we just allow playbin to do its thing, which will re-start the
-        // device and start at the desired track
-        return FALSE;
-    }
-
-    cdda_src = bp_cdda_get_cdda_source (playbin);
-    if (G_UNLIKELY (cdda_src == NULL)) {
-        return FALSE;
-    }
-    
-    if (gst_element_seek (playbin, 1.0, format, GST_SEEK_FLAG_FLUSH, 
-        GST_SEEK_TYPE_SET, track - 1, GST_SEEK_TYPE_NONE, -1)) {
-        bp_debug ("bp_cdda: seeking to track %d, avoiding playbin", track);
-        g_object_unref (cdda_src);
-        return TRUE;
-    }
-    
-    g_object_unref (cdda_src);
-    return FALSE;
-}
-
-static gboolean
-bp_cdda_handle_uri (BansheePlayer *player, const gchar *uri)
-{
-    // Processes URIs like cdda://<track-number>#<device-node> and overrides
-    // track transitioning through playbin if playback was already happening
-    // from the device node by seeking directly to the track since the disc
-    // is already spinning; playbin doesn't handle CDDA URIs with device nodes
-    // so we have to handle setting the device property on GstCddaBaseSrc 
-    // through the notify::source signal on playbin
-
-    const gchar *new_cdda_device;
-    const gchar *p;
-    
-    if (player == NULL || uri == NULL || !g_str_has_prefix (uri, "cdda://")) {
-        // Something is hosed or the URI isn't actually CDDA
-        if (player->cdda_device != NULL) {
-            bp_debug ("bp_cdda: finished using device (%s)", player->cdda_device);
-            g_free (player->cdda_device);
-            player->cdda_device = NULL;
-        }
-        
-        return FALSE;
-    }
-
-    p = g_utf8_strchr (uri, -1, '#');
-    if (p == NULL || strlen (p) < 2) {
-        // Unset the cached device node if the URI doesn't
-        // have its own valid device node
-        g_free (player->cdda_device);
-        player->cdda_device = NULL;
-        bp_debug ("bp_cdda: invalid device node in URI (%s)", uri);
-        return FALSE;
-    }
-    
-    new_cdda_device = p + 1;
-            
-    if (player->cdda_device == NULL) {
-        // If we weren't already playing from a CD, cache the
-        // device and allow playbin to begin playing it
-        player->cdda_device = g_strdup (new_cdda_device);
-        bp_debug ("bp_cdda: storing device node for fast seeks (%s)", player->cdda_device);
-        return FALSE;
-    }
-    
-    if (strcmp (new_cdda_device, player->cdda_device) == 0) {
-        // Parse the track number from the URI and seek directly to it
-        // since we are already playing from the device; prevent playbin
-        // from stopping/starting the CD, which can take many many seconds
-        gchar *track_str = g_strndup (uri + 7, strlen (uri) - strlen (new_cdda_device) - 8);
-        gint track_num = atoi (track_str);
-        g_free (track_str);
-        bp_debug ("bp_cdda: fast seeking to track on already playing device (%s)", player->cdda_device);
-        
-        return bp_cdda_source_seek_to_track (player->playbin, track_num);
-    }
-    
-    // We were already playing some CD, but switched to a different device node, 
-    // so unset and re-cache the new device node and allow playbin to do its thing
-    bp_debug ("bp_cdda: switching devices for CDDA playback (from %s, to %s)", player->cdda_device, new_cdda_device);
-    g_free (player->cdda_device);
-    player->cdda_device = g_strdup(new_cdda_device);
-    
-    return FALSE;
-}
+#endif /* _BANSHEE_PLAYER_CDDA_H */

Modified: trunk/banshee/libbanshee/banshee-player.c
==============================================================================
--- trunk/banshee/libbanshee/banshee-player.c	(original)
+++ trunk/banshee/libbanshee/banshee-player.c	Mon Mar 31 19:20:32 2008
@@ -410,7 +410,7 @@
     g_signal_connect (bus, "sync-message::element", 
         G_CALLBACK (bp_bus_element_sync_message), player);
 
-    g_signal_connect (player->playbin, "notify::source", G_CALLBACK (bp_cdda_on_notify_source), player);
+    g_signal_connect (player->playbin, "notify::source", G_CALLBACK (_bp_cdda_on_notify_source), player);
     
     if (GST_IS_BIN (videosink)) {
         g_signal_connect (videosink, "element-added",
@@ -560,7 +560,7 @@
         return;
     }
 
-    if (bp_cdda_handle_uri (player, uri)) {
+    if (_bp_cdda_handle_uri (player, uri)) {
         return;
     }
     

Modified: trunk/banshee/libbanshee/libbanshee.mdp
==============================================================================
--- trunk/banshee/libbanshee/libbanshee.mdp	(original)
+++ trunk/banshee/libbanshee/libbanshee.mdp	Mon Mar 31 19:20:32 2008
@@ -8,24 +8,23 @@
     </Configuration>
   </Configurations>
   <Contents>
-    <File name="." subtype="Directory" buildaction="Nothing" />
-    <File name="gst-cd-rip.h" subtype="Code" buildaction="Nothing" />
     <File name="gst-cd-rip-0.10.c" subtype="Code" buildaction="Compile" />
-    <File name="gst-mbtrm.h" subtype="Code" buildaction="Nothing" />
-    <File name="gst-misc.h" subtype="Code" buildaction="Nothing" />
     <File name="gst-misc-0.10.c" subtype="Code" buildaction="Compile" />
     <File name="banshee-player.c" subtype="Code" buildaction="Compile" />
-    <File name="gst-transcode.h" subtype="Code" buildaction="Nothing" />
     <File name="gst-transcode-0.10.c" subtype="Code" buildaction="Compile" />
     <File name="banshee-player.h" subtype="Code" buildaction="Nothing" />
-    <File name="banshee-player-cdda.h" subtype="Code" buildaction="Compile" />
+    <File name="banshee-player-cdda.h" subtype="Code" buildaction="Nothing" />
+    <File name="gst-cd-rip.h" subtype="Code" buildaction="Nothing" />
+    <File name="gst-misc.h" subtype="Code" buildaction="Nothing" />
+    <File name="gst-transcode.h" subtype="Code" buildaction="Nothing" />
+    <File name="banshee-player-cdda.c" subtype="Code" buildaction="Compile" />
   </Contents>
   <compiler ctype="GccCompiler" />
   <MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="True" RelativeMakefileName="Makefile.am">
     <BuildFilesVar Sync="True" Name="libbanshee_la_SOURCES" />
     <DeployFilesVar />
     <ResourcesVar />
-    <OthersVar />
+    <OthersVar Sync="True" Name="noinst_HEADERS" />
     <GacRefVar />
     <AsmRefVar />
     <ProjectRefVar />

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/PersistentColumnController.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/PersistentColumnController.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/PersistentColumnController.cs	Mon Mar 31 19:20:32 2008
@@ -110,7 +110,6 @@
         
         public void Save ()
         {
-            Console.WriteLine ("Save");
             if (timer_id == 0) {
                 timer_id = GLib.Timeout.Add (500, OnTimeout);
             } else {

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp	Mon Mar 31 19:20:32 2008
@@ -102,6 +102,7 @@
     <File name="Banshee.Gui/BansheeDbFormatMigratorMonitor.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Collection.Gui/TerseTrackListView.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Collection.Gui/ColumnCellTrack.cs" subtype="Code" buildaction="Compile" />
+    <File name="Banshee.Sources.Gui/ITrackModelSourceContents.cs" subtype="Code" buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Project" localcopy="False" refto="Hyena.Gui" />

Modified: trunk/banshee/src/Extensions/Extensions.mds
==============================================================================
--- trunk/banshee/src/Extensions/Extensions.mds	(original)
+++ trunk/banshee/src/Extensions/Extensions.mds	Mon Mar 31 19:20:32 2008
@@ -10,6 +10,16 @@
       <Entry build="True" name="Banshee.AudioCd" configuration="Debug" />
     </Configuration>
   </Configurations>
+  <StartMode single="True">
+    <Execute type="None" entry="Banshee.Daap" />
+    <Execute type="None" entry="Banshee.NotificationArea" />
+    <Execute type="None" entry="Banshee.MultimediaKeys" />
+    <Execute type="None" entry="Banshee.PlayQueue" />
+    <Execute type="None" entry="Banshee.Plugins.Lastfm" />
+    <Execute type="None" entry="Banshee.NowPlaying" />
+    <Execute type="None" entry="Banshee.Bookmarks" />
+    <Execute type="None" entry="Banshee.AudioCd" />
+  </StartMode>
   <Entries>
     <Entry filename="Banshee.NotificationArea/Banshee.Daap.mdp" />
     <Entry filename="Banshee.NotificationArea/Banshee.NotificationArea.mdp" />
@@ -20,4 +30,4 @@
     <Entry filename="Banshee.Bookmarks/Banshee.Bookmarks.mdp" />
     <Entry filename="Banshee.AudioCd/Banshee.AudioCd.mdp" />
   </Entries>
-</Combine>
+</Combine>
\ No newline at end of file

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui.mdp
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui.mdp	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui.mdp	Mon Mar 31 19:20:32 2008
@@ -63,6 +63,7 @@
     <File name="Hyena.Query.Gui/NullQueryValueEntry.cs" subtype="Code" buildaction="Compile" />
     <File name="Hyena.Query.Gui/RelativeTimeSpanQueryValueEntry.cs" subtype="Code" buildaction="Compile" />
     <File name="Hyena.Query.Gui/TimeSpanQueryValueEntry.cs" subtype="Code" buildaction="Compile" />
+    <File name="Hyena.Data.Gui/IListView.cs" subtype="Code" buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />



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