banshee r3526 - in trunk/banshee: . libbanshee src/Backends/Banshee.GStreamer/Banshee.GStreamer src/Core/Banshee.Services/Banshee.MediaEngine src/Extensions/Banshee.NowPlaying src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying
- From: abock svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r3526 - in trunk/banshee: . libbanshee src/Backends/Banshee.GStreamer/Banshee.GStreamer src/Core/Banshee.Services/Banshee.MediaEngine src/Extensions/Banshee.NowPlaying src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying
- Date: Mon, 24 Mar 2008 19:46:10 +0000 (GMT)
Author: abock
Date: Mon Mar 24 19:46:10 2008
New Revision: 3526
URL: http://svn.gnome.org/viewvc/banshee?rev=3526&view=rev
Log:
2008-03-24 Aaron Bockover <abock gnome org>
* libbanshee/gst-playback-0.10.c:
* src/Backends/Banshee.GStreamer/Banshee.GStreamer/PlayerEngine.cs:
* src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngine.cs:
* src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/VisualisationConfigBox.cs:
* src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingInterface.cs:
* src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingSource.cs:
* src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying.mdp:
* src/Extensions/Banshee.NowPlaying/Makefile.am: Reverted Alexander Hixon's
visualization patches from 2008-03-23 since a number of people have been
reporting playback issues after this landed - also it had no review
Removed:
trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/VisualisationConfigBox.cs
Modified:
trunk/banshee/ChangeLog
trunk/banshee/libbanshee/gst-playback-0.10.c
trunk/banshee/src/Backends/Banshee.GStreamer/Banshee.GStreamer/PlayerEngine.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngine.cs
trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying.mdp
trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingInterface.cs
trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingSource.cs
trunk/banshee/src/Extensions/Banshee.NowPlaying/Makefile.am
Modified: trunk/banshee/libbanshee/gst-playback-0.10.c
==============================================================================
--- trunk/banshee/libbanshee/gst-playback-0.10.c (original)
+++ trunk/banshee/libbanshee/gst-playback-0.10.c Mon Mar 24 19:46:10 2008
@@ -54,11 +54,6 @@
#define IS_GST_PLAYBACK(e) (e != NULL)
#define SET_CALLBACK(cb_name) { if(engine != NULL) { engine->cb_name = cb; } }
-// Visualisation defaults
-#define DEFAULT_FPS 20
-#define DEFAULT_WIDTH 320
-#define DEFAULT_HEIGHT 240
-
typedef struct GstPlayback GstPlayback;
typedef void (* GstPlaybackEosCallback) (GstPlayback *engine);
@@ -83,8 +78,6 @@
GstXOverlay *xoverlay;
GdkWindow *video_window;
#endif
-
- GList *visualisations;
guint iterate_timeout_id;
gchar *cdda_device;
@@ -439,97 +432,6 @@
#endif
}
-static gboolean
-filter_features (GstPluginFeature * feature, gpointer data)
-{
- GstElementFactory *f;
-
- if (!GST_IS_ELEMENT_FACTORY (feature))
- return FALSE;
- f = GST_ELEMENT_FACTORY (feature);
- if (!g_strrstr (gst_element_factory_get_klass (f), "Visualization"))
- return FALSE;
-
- return TRUE;
-}
-
-void
-gst_playback_set_active_visualisation (GstPlayback *engine, const gchar *name, gint width, gint height, gint fps)
-{
- //g_debug ("Setting active visulisation: %s", name);
- GList *feature;
- GstElementFactory *tmp;
- GstElementFactory *fac = NULL;
- GstElement *vis_bin;
- GstElement *vis_element;
- GstElement *vis_capsfilter;
- GstPad *pad;
- GstCaps *caps;
-
- if (engine == NULL || name == NULL || engine->visualisations == NULL) {
- return;
- }
-
- for (feature = engine->visualisations; feature; feature = feature->next) {
- tmp = GST_ELEMENT_FACTORY(feature->data);
- if (!strcmp(GST_PLUGIN_FEATURE_NAME(tmp), name))
- fac = tmp;
- }
-
- vis_element = gst_element_factory_create (fac, "vis_element");
- if (vis_element == NULL) {
- return;
- }
-
- vis_capsfilter = gst_element_factory_make("capsfilter", "vis_capsfilter");
- g_return_if_fail(GST_IS_ELEMENT(vis_capsfilter));
-
- vis_bin = gst_bin_new ("vis_bin");
- g_return_if_fail(GST_IS_ELEMENT (vis_bin));
-
- gst_bin_add_many(GST_BIN(vis_bin), vis_element, vis_capsfilter, NULL);
-
- /* Sink ghostpad */
- pad = gst_element_get_pad(vis_element, "sink");
- gst_element_add_pad(vis_bin, gst_ghost_pad_new("sink", pad));
- gst_object_unref(pad);
-
- /* Source ghostpad, link with vis_element */
- pad = gst_element_get_pad(vis_capsfilter, "src");
- gst_element_add_pad(vis_bin, gst_ghost_pad_new("src", pad));
- gst_element_link_pads(vis_element, "src", vis_capsfilter, "sink");
- gst_object_unref (pad);
-
- /* Get allowed output caps from visualisation element */
- pad = gst_element_get_pad(vis_element, "src");
- caps = gst_pad_get_allowed_caps(pad);
- gst_object_unref(pad);
-
- /* Can we fixate ? */
- if (caps && !gst_caps_is_fixed(caps)) {
- guint i;
-
- caps = gst_caps_make_writable(caps);
-
- /* Get visualization size */
- for (i = 0; i < gst_caps_get_size (caps); ++i) {
- GstStructure *s = gst_caps_get_structure (caps, i);
-
- /* Fixate */
- gst_structure_fixate_field_nearest_int(s, "width", width);
- gst_structure_fixate_field_nearest_int(s, "height", height);
- gst_structure_fixate_field_nearest_fraction(s, "framerate", fps, 1);
- }
-
- /* set this */
- g_object_set(vis_capsfilter, "caps", caps, NULL);
- }
-
- if (vis_bin != NULL) {
- g_object_set (G_OBJECT (engine->playbin), "vis-plugin", vis_bin, NULL);
- }
-}
-
static gboolean
gst_playback_construct(GstPlayback *engine)
{
@@ -540,9 +442,6 @@
GstElement *audioconvert;
GstPad *teepad;
- GList *feature;
- gchar *default_vis;
-
g_return_val_if_fail(IS_GST_PLAYBACK(engine), FALSE);
// create necessary elements
@@ -614,16 +513,6 @@
}
}
- engine->visualisations = gst_registry_feature_filter(gst_registry_get_default(),
- filter_features, FALSE, NULL);
-
- // Set first as default
- if (engine->visualisations != NULL && g_list_length (engine->visualisations) > 0) {
- feature = g_list_first (engine->visualisations);
- default_vis = GST_PLUGIN_FEATURE_NAME (GST_ELEMENT_FACTORY (feature->data));
- gst_playback_set_active_visualisation (engine, default_vis, DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_FPS);
- }
-
g_object_set (G_OBJECT (engine->playbin), "video-sink", videosink, NULL);
bus = gst_pipeline_get_bus (GST_PIPELINE (engine->playbin));
@@ -707,8 +596,6 @@
g_mutex_free (engine->mutex);
- g_list_free(engine->visualisations);
-
if(GST_IS_OBJECT(engine->playbin)) {
engine->target_state = GST_STATE_NULL;
gst_element_set_state(engine->playbin, GST_STATE_NULL);
@@ -970,37 +857,6 @@
*stream = GST_STREAM_ERROR;
}
-gchar *
-gst_playback_get_visualisation_name (GstPlayback *engine, gint index)
-{
- GList *feature;
- gchar *ret;
-
- if (engine == NULL || index < 0) {
- return NULL;
- }
-
- //g_debug ("Getting nth feature %d", index);
- feature = g_list_nth (engine->visualisations, index);
- if (feature != NULL) {
- ret = g_strdup (GST_PLUGIN_FEATURE_NAME (GST_ELEMENT_FACTORY (feature->data)));
- } else {
- return NULL;
- }
-
- return ret;
-}
-
-gint
-gst_playback_get_visualisation_count (GstPlayback *engine)
-{
- if (engine == NULL) {
- return 0;
- }
-
- return g_list_length (engine->visualisations);
-}
-
/* Region XOverlay */
#ifdef GDK_WINDOWING_X11
Modified: trunk/banshee/src/Backends/Banshee.GStreamer/Banshee.GStreamer/PlayerEngine.cs
==============================================================================
--- trunk/banshee/src/Backends/Banshee.GStreamer/Banshee.GStreamer/PlayerEngine.cs (original)
+++ trunk/banshee/src/Backends/Banshee.GStreamer/Banshee.GStreamer/PlayerEngine.cs Mon Mar 24 19:46:10 2008
@@ -280,12 +280,6 @@
return item;
}
- public override void SetCurrentVisualisation (string name, int width, int height, int fps)
- {
- gst_playback_set_active_visualisation (handle, name, width, height, fps);
- }
-
-
public override ushort Volume {
get { return (ushort)gst_playback_get_volume (handle); }
set {
@@ -348,25 +342,6 @@
public override IntPtr VideoWindow {
set { gst_playback_set_video_window (handle, value); }
}
-
- public override string [] Visualisations {
- get {
- // Yes, this is yucky, but it's *much* cleaner than trying
- // to marshal string arrays nicely. :)
-
- string [] ret = null;
- int count = gst_playback_get_visualisation_count (handle);
-
- if (count > 0) {
- ret = new string [count];
- for (int i = 0; i < count; i++) {
- ret [i] = gst_playback_get_visualisation_name (handle, i);
- }
- }
-
- return ret;
- }
- }
public double AmplifierLevel {
set {
@@ -488,16 +463,7 @@
[DllImport ("libbanshee")]
private static extern void gst_playback_expose_video_window (HandleRef engine, IntPtr window, bool direct);
-
- [DllImport ("libbanshee")]
- private static extern void gst_playback_set_active_visualisation (HandleRef engine, string name, int width, int height, int fps);
-
- [DllImport ("libbanshee")]
- private static extern int gst_playback_get_visualisation_count (HandleRef engine);
-
- [DllImport ("libbanshee")]
- private static extern string gst_playback_get_visualisation_name (HandleRef engine, int count);
-
+
[DllImport ("libbanshee")]
private static extern void gst_playback_get_error_quarks (out uint core, out uint library,
out uint resource, out uint stream);
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngine.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngine.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngine.cs Mon Mar 24 19:46:10 2008
@@ -225,10 +225,6 @@
OnEventChanged (PlayerEngineEvent.TrackInfoUpdated);
}
- public virtual void SetCurrentVisualisation (string name, int width, int height, int fps)
- {
- }
-
public TrackInfo CurrentTrack {
get { return current_track; }
}
@@ -290,9 +286,5 @@
public virtual IntPtr VideoWindow {
set { }
}
-
- public virtual string [] Visualisations {
- get { return null; }
- }
}
}
Modified: trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying.mdp
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying.mdp (original)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying.mdp Mon Mar 24 19:46:10 2008
@@ -12,7 +12,6 @@
<File name="Banshee.NowPlaying/NowPlayingSource.cs" subtype="Code" buildaction="Compile" />
<File name="Banshee.NowPlaying/NowPlayingInterface.cs" subtype="Code" buildaction="Compile" />
<File name="Banshee.NowPlaying/VideoDisplay.cs" subtype="Code" buildaction="Compile" />
- <File name="Banshee.NowPlaying/VisualisationConfigBox.cs" subtype="Code" buildaction="Compile" />
</Contents>
<References>
<ProjectReference type="Project" localcopy="True" refto="Banshee.Core" />
Modified: trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingInterface.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingInterface.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingInterface.cs Mon Mar 24 19:46:10 2008
@@ -28,6 +28,7 @@
using System;
+using Mono.Unix;
using Gtk;
using Banshee.Sources;
@@ -41,55 +42,21 @@
private NowPlayingSource source;
private VideoDisplay video_display;
private Hyena.Widgets.RoundedFrame frame;
- private Hyena.Gui.AnimatedVBox anim_vbox;
-
- private VisualisationConfigBox vis_box;
- private VisualisationConfigBox old_box;
public NowPlayingInterface ()
{
video_display = new VideoDisplay ();
video_display.Show ();
- vis_box = new VisualisationConfigBox ();
- vis_box.BorderWidth = 6;
- vis_box.Show ();
-
- anim_vbox = new Hyena.Gui.AnimatedVBox ();
- anim_vbox.Spacing = 6;
- anim_vbox.Show ();
-
frame = new Hyena.Widgets.RoundedFrame ();
frame.SetFillColor (new Cairo.Color (0, 0, 0));
frame.DrawBorder = false;
frame.Add (video_display);
frame.Show ();
- ShowVisualisationBox ();
- PackStart (anim_vbox, false, false, 0);
PackStart (frame, true, true, 0);
}
- public void ShowVisualisationBox ()
- {
- if (!anim_vbox.Contains (vis_box)) {
- if (old_box != null) {
- vis_box = new VisualisationConfigBox (old_box);
- old_box.Dispose ();
- }
-
- anim_vbox.Add (vis_box);
- }
- }
-
- public void HideVisualisationBox ()
- {
- if (anim_vbox.Contains (vis_box)) {
- anim_vbox.Remove (vis_box, Hyena.Gui.Easing.QuadraticOut);
- old_box = vis_box;
- }
- }
-
#region ISourceContents
public bool SetSource (ISource src)
Modified: trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingSource.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingSource.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingSource.cs Mon Mar 24 19:46:10 2008
@@ -42,14 +42,11 @@
public class NowPlayingSource : Source, IDisposable
{
private TrackInfo transitioned_track;
- private NowPlayingInterface nowplaying_interface;
public NowPlayingSource () : base ("now-playing", Catalog.GetString ("Now Playing"), 0)
{
- nowplaying_interface = new NowPlayingInterface ();
-
Properties.SetString ("Icon.Name", "media-playback-start");
- Properties.Set<ISourceContents> ("Nereid.SourceContents", nowplaying_interface);
+ Properties.Set<ISourceContents> ("Nereid.SourceContents", new NowPlayingInterface ());
Properties.Set<bool> ("Nereid.SourceContents.HeaderVisible", false);
ServiceManager.SourceManager.AddSource (this);
@@ -66,15 +63,9 @@
private void OnPlaybackControllerTrackStarted (object o, EventArgs args)
{
TrackInfo current_track = ServiceManager.PlaybackController.CurrentTrack;
- if (current_track != null &&
+ if (current_track != null && transitioned_track != current_track &&
(current_track.MediaAttributes & TrackMediaAttributes.VideoStream) != 0) {
- if (transitioned_track != current_track) {
- ServiceManager.SourceManager.SetActiveSource (this);
- }
-
- nowplaying_interface.HideVisualisationBox ();
- } else {
- nowplaying_interface.ShowVisualisationBox ();
+ ServiceManager.SourceManager.SetActiveSource (this);
}
}
Modified: trunk/banshee/src/Extensions/Banshee.NowPlaying/Makefile.am
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NowPlaying/Makefile.am (original)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying/Makefile.am Mon Mar 24 19:46:10 2008
@@ -6,8 +6,7 @@
SOURCES = \
Banshee.NowPlaying/NowPlayingInterface.cs \
Banshee.NowPlaying/NowPlayingSource.cs \
- Banshee.NowPlaying/VideoDisplay.cs \
- Banshee.NowPlaying/VisualisationConfigBox.cs
+ Banshee.NowPlaying/VideoDisplay.cs
RESOURCES = Banshee.NowPlaying.addin.xml
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]