banshee r4949 - in trunk/banshee: . build libbanshee src/Core/Banshee.Services src/Extensions src/Extensions/Banshee.NowPlaying.Clutter src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter src/Extensions/Banshee.NowPlaying.Clutter/Clutter src/Extensions/Banshee.NowPlaying.Clutter/Clutter.Gtk src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying
- From: abock svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r4949 - in trunk/banshee: . build libbanshee src/Core/Banshee.Services src/Extensions src/Extensions/Banshee.NowPlaying.Clutter src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter src/Extensions/Banshee.NowPlaying.Clutter/Clutter src/Extensions/Banshee.NowPlaying.Clutter/Clutter.Gtk src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying
- Date: Sun, 25 Jan 2009 03:03:10 +0000 (UTC)
Author: abock
Date: Sun Jan 25 03:03:09 2009
New Revision: 4949
URL: http://svn.gnome.org/viewvc/banshee?rev=4949&view=rev
Log:
2009-01-24 Aaron Bockover <abock gnome org>
Second pass, working video display and sizing, not hacky at all, just
pure awesome on the way. Super high performance video.
* src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter/NowPlayingSource.cs:
Bare source for the new clutter now playing extension
* src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter/NowPlayingInterface.cs:
Basic clutter UI for rendering the video texture from the clutter sink
in the media pipeline; simple embed + stage + texture and size/position
logic is in place
* src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Group.cs:
* src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Color.cs:
* src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Texture.cs:
* src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Stage.cs:
* src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Actor.cs:
* src/Extensions/Banshee.NowPlaying.Clutter/Clutter.Gtk/Embed.cs:
Very basic and simple Clutter bindings; just enough for what I need now.
These will go away as I work on clutter-sharp and make it a dependency
later. I just wanted to get off the ground quickly.
* src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingContents.cs:
* src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingSource.cs:
Move the VideoDisplayContextType detection to the source, throw if it is
not valid so the source does not appear
* libbanshee/banshee-player-vis.c: Fix a double-free bug
Added:
trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/ (props changed)
trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter/ (props changed)
trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter.addin.xml (contents, props changed)
trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter.csproj (contents, props changed)
trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter.dll.config
trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter/NowPlayingInterface.cs
trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter/NowPlayingSource.cs
trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter/
trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter.Gtk/
trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter.Gtk/Embed.cs
trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Actor.cs
trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Color.cs
trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Group.cs
trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Stage.cs
trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Texture.cs
trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Makefile.am
Modified:
trunk/banshee/Banshee.sln
trunk/banshee/ChangeLog
trunk/banshee/build/build.environment.mk
trunk/banshee/configure.ac
trunk/banshee/libbanshee/banshee-player-vis.c
trunk/banshee/libbanshee/libbanshee.cproj
trunk/banshee/src/Core/Banshee.Services/Banshee.Services.csproj
trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingContents.cs
trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingSource.cs
trunk/banshee/src/Extensions/Makefile.am
Modified: trunk/banshee/Banshee.sln
==============================================================================
--- trunk/banshee/Banshee.sln (original)
+++ trunk/banshee/Banshee.sln Sun Jan 25 03:03:09 2009
@@ -88,6 +88,8 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Banshee.SqlDebugConsole", "src\Extensions\Banshee.SqlDebugConsole\Banshee.SqlDebugConsole.csproj", "{0E1A7F20-E49B-4F9D-AEA0-2B1AD64326AC}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Banshee.NowPlaying.Clutter", "src\Extensions\Banshee.NowPlaying.Clutter\Banshee.NowPlaying.Clutter.csproj", "{694E4C7C-9385-47D6-A76E-911FC057E89D}"
+EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{4F47D6F1-4047-4A89-AE85-3AE5EF9F2961}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hyena", "src\Libraries\Hyena\Hyena.csproj", "{95374549-9553-4C1E-9D89-667755F90E12}"
@@ -147,6 +149,8 @@
{4F66A4DE-5204-4150-8D0B-CE21CA52E309}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6171E5DE-5B36-4AE4-8707-F6BEE0AD945B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6171E5DE-5B36-4AE4-8707-F6BEE0AD945B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {694E4C7C-9385-47D6-A76E-911FC057E89D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {694E4C7C-9385-47D6-A76E-911FC057E89D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6B73E278-23FB-4A59-9B44-AB7F0212B936}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6B73E278-23FB-4A59-9B44-AB7F0212B936}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6B781836-AB65-49EF-BECD-CCC193C5D589}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -248,6 +252,7 @@
{A993A473-1A18-4D12-ADF1-9CF3E0E12637} = {4DD1DE63-F20B-4FC3-8FDA-F0BDF4183722}
{12984BDF-C565-4452-AD47-79BD3C440E28} = {4DD1DE63-F20B-4FC3-8FDA-F0BDF4183722}
{0E1A7F20-E49B-4F9D-AEA0-2B1AD64326AC} = {4DD1DE63-F20B-4FC3-8FDA-F0BDF4183722}
+ {694E4C7C-9385-47D6-A76E-911FC057E89D} = {4DD1DE63-F20B-4FC3-8FDA-F0BDF4183722}
{95374549-9553-4C1E-9D89-667755F90E12} = {4F47D6F1-4047-4A89-AE85-3AE5EF9F2961}
{C856EFD8-E812-4E61-8B76-E3583D94C233} = {4F47D6F1-4047-4A89-AE85-3AE5EF9F2961}
{C1F63FC5-4B96-48B2-B7F7-5B33FCC4F2A2} = {4F47D6F1-4047-4A89-AE85-3AE5EF9F2961}
Modified: trunk/banshee/build/build.environment.mk
==============================================================================
--- trunk/banshee/build/build.environment.mk (original)
+++ trunk/banshee/build/build.environment.mk Sun Jan 25 03:03:09 2009
@@ -133,6 +133,7 @@
LINK_EXTENSION_NOWPLAYING = -r:$(DIR_BIN)/Banshee.NowPlaying.dll
LINK_EXTENSION_NOWPLAYING_DEPS = $(REF_EXTENSION_NOWPLAYING) \
$(LINK_EXTENSION_NOWPLAYING)
+REF_EXTENSION_NOWPLAYING_CLUTTER = $(LINK_BANSHEE_THICKCLIENT_DEPS)
REF_EXTENSION_PODCASTING = $(LINK_MIGO_DEPS) $(LINK_BANSHEE_THICKCLIENT_DEPS)
REF_EXTENSION_SAMPLE = $(LINK_BANSHEE_THICKCLIENT_DEPS)
REF_EXTENSION_REMOTE_AUDIO = $(LINK_BANSHEE_THICKCLIENT_DEPS) $(LINK_MONO_ZEROCONF)
Modified: trunk/banshee/configure.ac
==============================================================================
--- trunk/banshee/configure.ac (original)
+++ trunk/banshee/configure.ac Sun Jan 25 03:03:09 2009
@@ -241,6 +241,7 @@
src/Extensions/Banshee.MultimediaKeys/Makefile
src/Extensions/Banshee.NotificationArea/Makefile
src/Extensions/Banshee.NowPlaying/Makefile
+src/Extensions/Banshee.NowPlaying.Clutter/Makefile
src/Extensions/Banshee.PlayQueue/Makefile
src/Extensions/Banshee.PlayerMigration/Makefile
src/Extensions/Banshee.Podcasting/Makefile
Modified: trunk/banshee/libbanshee/banshee-player-vis.c
==============================================================================
--- trunk/banshee/libbanshee/banshee-player-vis.c (original)
+++ trunk/banshee/libbanshee/banshee-player-vis.c Sun Jan 25 03:03:09 2009
@@ -164,7 +164,9 @@
if (player->vis_buffer != NULL) {
gst_object_unref (player->vis_buffer);
player->vis_buffer = NULL;
-
+ }
+
+ if (player->spectrum_buffer != NULL) {
g_free (player->spectrum_buffer);
player->spectrum_buffer = NULL;
}
Modified: trunk/banshee/libbanshee/libbanshee.cproj
==============================================================================
--- trunk/banshee/libbanshee/libbanshee.cproj (original)
+++ trunk/banshee/libbanshee/libbanshee.cproj Sun Jan 25 03:03:09 2009
@@ -61,7 +61,7 @@
<BuildFilesVar Sync="true" Name="libbanshee_la_SOURCES" />
<DeployFilesVar />
<ResourcesVar />
- <OthersVar Sync="true" Name="noinst_HEADERS" />
+ <OthersVar />
<GacRefVar />
<AsmRefVar />
<ProjectRefVar />
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Services.csproj
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Services.csproj (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Services.csproj Sun Jan 25 03:03:09 2009
@@ -160,7 +160,6 @@
<Compile Include="Banshee.Query\SmartPlaylistQueryValue.cs" />
<Compile Include="Banshee.Query\YearQueryValue.cs" />
<Compile Include="Banshee.MediaEngine\NullPlayerEngine.cs" />
- <Compile Include="Banshee.PlayerMigration\AmarokPlayerImportSource.cs" />
<Compile Include="Banshee.Library\ThreadPoolImportSource.cs" />
<Compile Include="Banshee.ServiceStack\IInitializeService.cs" />
<Compile Include="Banshee.Query\PlaylistQueryValue.cs" />
Added: trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter.addin.xml
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter.addin.xml Sun Jan 25 03:03:09 2009
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Addin
+ id="Banshee.NowPlaying.Clutter"
+ version="1.0"
+ compatVersion="1.0"
+ copyright="Â 2009 Novell Inc. Licensed under the MIT X11 license."
+ name="Now Playing"
+ category="required:User Interface"
+ description="Provides a source that displays embedded video and provides fullscreen video playback and controls."
+ author="Aaron Bockover"
+ url="http://banshee-project.org/"
+ defaultEnabled="true">
+
+ <Dependencies>
+ <Addin id="Banshee.Services" version="1.0"/>
+ <Addin id="Banshee.ThickClient" version="1.0"/>
+ </Dependencies>
+
+ <Extension path="/Banshee/SourceManager/Source">
+ <Source class="Banshee.NowPlaying.Clutter.NowPlayingSource"/>
+ </Extension>
+
+</Addin>
Added: trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter.csproj
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter.csproj Sun Jan 25 03:03:09 2009
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <ProjectGuid>{694E4C7C-9385-47D6-A76E-911FC057E89D}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <UseParentDirectoryAsNamespace>true</UseParentDirectoryAsNamespace>
+ <AssemblyName>Banshee.NowPlaying.Clutter</AssemblyName>
+ <SchemaVersion>2.0</SchemaVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>..\..\..\bin</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
+ <CustomCommands>
+ <CustomCommands>
+ <Command type="Build" command="make" workingdir="${SolutionDir}" />
+ <Command type="Execute" command="make run" workingdir="${SolutionDir}" />
+ </CustomCommands>
+ </CustomCommands>
+ <AssemblyKeyFile>.</AssemblyKeyFile>
+ </PropertyGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\Core\Banshee.Core\Banshee.Core.csproj">
+ <Project>{2ADB831A-A050-47D0-B6B9-9C19D60233BB}</Project>
+ <Name>Banshee.Core</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\Core\Banshee.Services\Banshee.Services.csproj">
+ <Project>{B28354F0-BA87-44E8-989F-B864A3C7C09F}</Project>
+ <Name>Banshee.Services</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\Libraries\Hyena\Hyena.csproj">
+ <Project>{95374549-9553-4C1E-9D89-667755F90E12}</Project>
+ <Name>Hyena</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\Libraries\Hyena.Gui\Hyena.Gui.csproj">
+ <Project>{C856EFD8-E812-4E61-8B76-E3583D94C233}</Project>
+ <Name>Hyena.Gui</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\Core\Banshee.Widgets\Banshee.Widgets.csproj">
+ <Project>{A3701765-E571-413D-808C-9788A22791AF}</Project>
+ <Name>Banshee.Widgets</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\Core\Banshee.ThickClient\Banshee.ThickClient.csproj">
+ <Project>{AC839523-7BDF-4AB6-8115-E17921B96EC6}</Project>
+ <Name>Banshee.ThickClient</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference Include="Mono.Posix" />
+ <Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference Include="Mono.Cairo, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
+ </ItemGroup>
+ <ItemGroup>
+ </ItemGroup>
+ <ItemGroup>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <ProjectExtensions>
+ <MonoDevelop>
+ <Properties>
+ <MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="true" RelativeMakefileName="Makefile.am">
+ <BuildFilesVar Sync="true" Name="SOURCES" />
+ <DeployFilesVar />
+ <ResourcesVar Sync="true" Name="RESOURCES" />
+ <OthersVar />
+ <GacRefVar />
+ <AsmRefVar />
+ <ProjectRefVar />
+ </MonoDevelop.Autotools.MakefileInfo>
+ </Properties>
+ </MonoDevelop>
+ </ProjectExtensions>
+ <ItemGroup>
+ <Compile Include="Banshee.NowPlaying.Clutter\NowPlayingSource.cs" />
+ <Compile Include="Banshee.NowPlaying.Clutter\NowPlayingInterface.cs" />
+ <Compile Include="Clutter\Color.cs" />
+ <Compile Include="Clutter\Actor.cs" />
+ <Compile Include="Clutter.Gtk\Embed.cs" />
+ <Compile Include="Clutter\Group.cs" />
+ <Compile Include="Clutter\Stage.cs" />
+ <Compile Include="Clutter\Texture.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Banshee.NowPlaying.Clutter.addin.xml" />
+ </ItemGroup>
+</Project>
\ No newline at end of file
Added: trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter.dll.config
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter.dll.config Sun Jan 25 03:03:09 2009
@@ -0,0 +1,5 @@
+<configuration>
+ <dllmap dll="clutter" target="libclutter-glx-0.8.so.0"/>
+ <dllmap dll="clutter-gtk" target="libclutter-gtk-0.8.so.0"/>
+</configuration>
+
Added: trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter/NowPlayingInterface.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter/NowPlayingInterface.cs Sun Jan 25 03:03:09 2009
@@ -0,0 +1,184 @@
+//
+// NowPlayingInterface.cs
+//
+// Author:
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2008-2009 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+using Mono.Unix;
+using Gtk;
+
+using Banshee.ServiceStack;
+using Banshee.Sources;
+using Banshee.Gui;
+using Banshee.Sources.Gui;
+
+using Clutter;
+using Clutter.Gtk;
+
+namespace Banshee.NowPlaying.Clutter
+{
+ public class NowPlayingInterface : VBox, ISourceContents
+ {
+ private NowPlayingSource source;
+
+ private Embed display;
+ private Stage stage;
+ private Texture video_texture;
+
+ public NowPlayingInterface ()
+ {
+ display = new Embed ();
+ stage = display.Stage;
+ video_texture = new Texture (Banshee.ServiceStack.ServiceManager.PlayerEngine.VideoDisplayContext);
+ video_texture.SizeChange += OnVideoTextureSizeChange;
+
+ stage.Color = Color.Black;
+ stage.Add (video_texture);
+
+ PackStart (display, true, true, 0);
+ Show ();
+ }
+
+ private void OnVideoTextureSizeChange (object o, SizeChangeArgs args)
+ {
+ ReallocateVideoTexture (args.Width, args.Height);
+ }
+
+ private void ReallocateVideoTexture (int textureWidth, int textureHeight)
+ {
+ int stage_width, stage_height;
+
+ stage.GetSize (out stage_width, out stage_height);
+
+ int new_x, new_y, new_width, new_height;
+
+ new_height = (textureHeight * stage_width) / textureWidth;
+ if (new_height <= stage_height) {
+ new_width = stage_width;
+ new_x = 0;
+ new_y = (stage_height - new_height) / 2;
+ } else {
+ new_width = (textureWidth * stage_height) / textureHeight;
+ new_height = stage_height;
+ new_x = (stage_width - new_width) / 2;
+ new_y = 0;
+ }
+
+ video_texture.SetPosition (new_x, new_y);
+ video_texture.SetSize (new_width, new_height);
+ }
+
+ protected override void OnSizeAllocated (Gdk.Rectangle allocation)
+ {
+ base.OnSizeAllocated (allocation);
+
+ int texture_width, texture_height;
+ video_texture.GetSize (out texture_width, out texture_height);
+ if (texture_width > 0 && texture_height > 0) {
+ ReallocateVideoTexture (texture_width, texture_height);
+ }
+ }
+
+
+#region Video Fullscreen Override
+
+ private ViewActions.FullscreenHandler previous_fullscreen_handler;
+
+ private void DisableFullscreenAction ()
+ {
+ InterfaceActionService service = ServiceManager.Get<InterfaceActionService> ();
+ Gtk.ToggleAction action = service.ViewActions["FullScreenAction"] as Gtk.ToggleAction;
+ if (action != null) {
+ action.Active = false;
+ }
+ }
+
+ internal void OverrideFullscreen ()
+ {
+ FullscreenHandler (false);
+
+ InterfaceActionService service = ServiceManager.Get<InterfaceActionService> ();
+ if (service == null || service.ViewActions == null) {
+ return;
+ }
+
+ previous_fullscreen_handler = service.ViewActions.Fullscreen;
+ service.ViewActions.Fullscreen = FullscreenHandler;
+ DisableFullscreenAction ();
+ }
+
+ internal void RelinquishFullscreen ()
+ {
+ FullscreenHandler (false);
+
+ InterfaceActionService service = ServiceManager.Get<InterfaceActionService> ();
+ if (service == null || service.ViewActions == null) {
+ return;
+ }
+
+ service.ViewActions.Fullscreen = previous_fullscreen_handler;
+ }
+
+ private void FullscreenHandler (bool fullscreen)
+ {
+ if (fullscreen) {
+ stage.Fullscreen ();
+ } else {
+ stage.Unfullscreen ();
+ }
+ }
+
+#endregion
+
+#region ISourceContents
+
+ public bool SetSource (ISource src)
+ {
+ this.source = source as NowPlayingSource;
+ if (display != null) {
+ display.Show ();
+ }
+ return this.source != null;
+ }
+
+ public ISource Source {
+ get { return source; }
+ }
+
+ public void ResetSource ()
+ {
+ source = null;
+ }
+
+ public Widget Widget {
+ get { return this; }
+ }
+
+#endregion
+
+ }
+}
Added: trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter/NowPlayingSource.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Banshee.NowPlaying.Clutter/NowPlayingSource.cs Sun Jan 25 03:03:09 2009
@@ -0,0 +1,125 @@
+//
+// NowPlayingSource.cs
+//
+// Author:
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2008-2009 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Mono.Unix;
+using Gtk;
+
+using Banshee.Sources;
+using Banshee.ServiceStack;
+using Banshee.MediaEngine;
+using Banshee.Collection;
+
+using Banshee.Gui;
+using Banshee.Sources.Gui;
+
+namespace Banshee.NowPlaying.Clutter
+{
+ public class NowPlayingSource : Source, IDisposable
+ {
+ private TrackInfo transitioned_track;
+ private NowPlayingInterface now_playing_interface;
+
+ public NowPlayingSource () : base ("now-playing-clutter", Catalog.GetString ("Now Playing Clutter"), 10)
+ {
+ if (Banshee.ServiceStack.ServiceManager.PlayerEngine.VideoDisplayContextType !=
+ Banshee.MediaEngine.VideoDisplayContextType.ClutterTexture) {
+ throw new ApplicationException ("Unsupported video display context");
+ }
+
+ TypeUniqueId = "now-playing-clutter";
+ now_playing_interface = new NowPlayingInterface ();
+
+ Properties.SetString ("Icon.Name", "applications-multimedia");
+ Properties.Set<ISourceContents> ("Nereid.SourceContents", now_playing_interface);
+ Properties.Set<bool> ("Nereid.SourceContents.HeaderVisible", false);
+ //Properties.SetString ("ActiveSourceUIResource", "ActiveSourceUI.xml");
+
+ ServiceManager.SourceManager.AddSource (this);
+
+ ServiceManager.PlaybackController.Transition += OnPlaybackControllerTransition;
+ ServiceManager.PlaybackController.TrackStarted += OnPlaybackControllerTrackStarted;
+ ServiceManager.PlayerEngine.ConnectEvent (OnTrackInfoUpdated, PlayerEvent.TrackInfoUpdated);
+ }
+
+ public void Dispose ()
+ {
+ ServiceManager.PlaybackController.Transition -= OnPlaybackControllerTransition;
+ ServiceManager.PlaybackController.TrackStarted -= OnPlaybackControllerTrackStarted;
+ ServiceManager.PlayerEngine.DisconnectEvent (OnTrackInfoUpdated);
+
+ if (now_playing_interface != null) {
+ now_playing_interface.Destroy ();
+ now_playing_interface.Dispose ();
+ now_playing_interface = null;
+ }
+ }
+
+ private void OnTrackInfoUpdated (PlayerEventArgs args)
+ {
+ CheckForSwitch ();
+ }
+
+ private void OnPlaybackControllerTrackStarted (object o, EventArgs args)
+ {
+ CheckForSwitch ();
+ }
+
+ private void OnPlaybackControllerTransition (object o, EventArgs args)
+ {
+ transitioned_track = ServiceManager.PlaybackController.CurrentTrack;
+ }
+
+ private void CheckForSwitch ()
+ {
+ TrackInfo current_track = ServiceManager.PlaybackController.CurrentTrack;
+ if (current_track != null && transitioned_track != current_track &&
+ (current_track.MediaAttributes & TrackMediaAttributes.VideoStream) != 0) {
+ ServiceManager.SourceManager.SetActiveSource (this);
+ }
+
+ if ((current_track.MediaAttributes & TrackMediaAttributes.VideoStream) != 0) {
+ OnUserNotifyUpdated ();
+ }
+ }
+
+ public override void Activate ()
+ {
+ if (now_playing_interface != null) {
+ now_playing_interface.OverrideFullscreen ();
+ }
+ }
+
+ public override void Deactivate ()
+ {
+ if (now_playing_interface != null) {
+ now_playing_interface.RelinquishFullscreen ();
+ }
+ }
+ }
+}
Added: trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter.Gtk/Embed.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter.Gtk/Embed.cs Sun Jan 25 03:03:09 2009
@@ -0,0 +1,65 @@
+//
+// Embed.cs
+//
+// Author:
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2009 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.InteropServices;
+
+using Gtk;
+using Clutter;
+
+namespace Clutter.Gtk
+{
+ public class Embed : Widget
+ {
+ public Embed (IntPtr raw) : base (raw)
+ {
+ }
+
+ [DllImport ("clutter-gtk")]
+ private static extern IntPtr gtk_clutter_embed_new ();
+
+ public Embed ()
+ {
+ Raw = gtk_clutter_embed_new ();
+ }
+
+ [DllImport ("clutter-gtk")]
+ private static extern IntPtr gtk_clutter_embed_get_stage (IntPtr handle);
+
+ public Stage Stage {
+ get { return new Stage (gtk_clutter_embed_get_stage (Handle)); }
+ }
+
+ [DllImport ("clutter-gtk")]
+ private static extern IntPtr gtk_clutter_embed_get_type ();
+
+ public static new GLib.GType GType {
+ get { return new GLib.GType (gtk_clutter_embed_get_type ()); }
+ }
+ }
+}
Added: trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Actor.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Actor.cs Sun Jan 25 03:03:09 2009
@@ -0,0 +1,84 @@
+//
+// Actor.cs
+//
+// Author:
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2009 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Clutter
+{
+ public class Actor : GLib.InitiallyUnowned
+ {
+ public Actor (IntPtr raw) : base (raw)
+ {
+ }
+
+ public Actor () : base (IntPtr.Zero)
+ {
+ CreateNativeObject (new string[0], new GLib.Value[0]);
+ }
+
+ [DllImport ("clutter")]
+ private static extern void clutter_actor_set_position (IntPtr handle, int x, int y);
+
+ public void SetPosition (int x, int y)
+ {
+ clutter_actor_set_position (Handle, x, y);
+ }
+
+ [DllImport ("clutter")]
+ private static extern void clutter_actor_get_position (IntPtr handle, out int x, out int y);
+
+ public void GetPosition (out int x, out int y)
+ {
+ clutter_actor_get_position (Handle, out x, out y);
+ }
+
+ [DllImport ("clutter")]
+ private static extern void clutter_actor_set_size (IntPtr handle, int width, int height);
+
+ public void SetSize (int width, int height)
+ {
+ clutter_actor_set_size (Handle, width, height);
+ }
+
+ [DllImport ("clutter")]
+ private static extern void clutter_actor_get_size (IntPtr handle, out int width, out int height);
+
+ public void GetSize (out int width, out int height)
+ {
+ clutter_actor_get_size (Handle, out width, out height);
+ }
+
+ [DllImport ("clutter")]
+ private static extern IntPtr clutter_actor_get_type ();
+
+ public static new GLib.GType GType {
+ get { return new GLib.GType (clutter_actor_get_type ()); }
+ }
+ }
+}
Added: trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Color.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Color.cs Sun Jan 25 03:03:09 2009
@@ -0,0 +1,99 @@
+//
+// Color.cs
+//
+// Author:
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2009 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Clutter
+{
+ public struct Color
+ {
+ public static Color Zero = new Color (0, 0, 0, 0);
+ public static Color Black = new Color (0, 0, 0);
+ public static Color White = new Color (0xff, 0xff, 0xff);
+
+ // The ClutterColor struct; do not add any other fields
+ private byte red;
+ private byte green;
+ private byte blue;
+ private byte alpha;
+
+ public Color (byte red, byte green, byte blue)
+ {
+ this.red = red;
+ this.green = green;
+ this.blue = blue;
+ this.alpha = 0xff;
+ }
+
+ public Color (byte red, byte green, byte blue, byte alpha)
+ {
+ this.red = red;
+ this.green = green;
+ this.blue = blue;
+ this.alpha = alpha;
+ }
+
+ public Color (uint rgbaColor)
+ {
+ this.red = (byte)(rgbaColor >> 24);
+ this.green = (byte)((rgbaColor >> 16) & 0xff);
+ this.blue = (byte)((rgbaColor >> 8) & 0xff);
+ this.alpha = (byte)(rgbaColor & 0xff);
+ }
+
+ public static Color FromRgb (uint rgbColor)
+ {
+ return new Color ((rgbColor << 8) | 0xff);
+ }
+
+ public static Color FromRgba (uint rgbaColor)
+ {
+ return new Color (rgbaColor);
+ }
+
+ public byte Red {
+ get { return red; }
+ set { red = value; }
+ }
+
+ public byte Green {
+ get { return green; }
+ set { green = value; }
+ }
+
+ public byte Blue {
+ get { return blue; }
+ set { blue = value; }
+ }
+
+ public byte Alpha {
+ get { return alpha; }
+ set { alpha = value; }
+ }
+ }
+}
Added: trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Group.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Group.cs Sun Jan 25 03:03:09 2009
@@ -0,0 +1,60 @@
+//
+// Group.cs
+//
+// Author:
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2009 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Clutter
+{
+ public class Group : Actor
+ {
+ public Group (IntPtr raw) : base (raw)
+ {
+ }
+
+ public Group () : base (IntPtr.Zero)
+ {
+ CreateNativeObject (new string[0], new GLib.Value[0]);
+ }
+
+ [DllImport ("clutter")]
+ private static extern void clutter_container_add (IntPtr handle, IntPtr actor, IntPtr zero);
+
+ public void Add (Actor actor)
+ {
+ clutter_container_add (Handle, actor.Handle, IntPtr.Zero);
+ }
+
+ [DllImport ("clutter")]
+ private static extern IntPtr clutter_group_get_type ();
+
+ public static new GLib.GType GType {
+ get { return new GLib.GType (clutter_group_get_type ()); }
+ }
+ }
+}
Added: trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Stage.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Stage.cs Sun Jan 25 03:03:09 2009
@@ -0,0 +1,84 @@
+//
+// Stage.cs
+//
+// Author:
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2009 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Clutter
+{
+ public class Stage : Group
+ {
+ public Stage (IntPtr raw) : base (raw)
+ {
+ }
+
+ public Stage () : base (IntPtr.Zero)
+ {
+ CreateNativeObject (new string[0], new GLib.Value[0]);
+ }
+
+ [DllImport ("clutter")]
+ private static extern void clutter_stage_fullscreen (IntPtr handle);
+
+ public void Fullscreen ()
+ {
+ clutter_stage_fullscreen (Handle);
+ }
+
+ [DllImport ("clutter")]
+ private static extern void clutter_stage_unfullscreen (IntPtr handle);
+
+ public void Unfullscreen ()
+ {
+ clutter_stage_unfullscreen (Handle);
+ }
+
+ [DllImport ("clutter")]
+ private static extern void clutter_stage_set_color (IntPtr handle, ref Color color);
+
+ [DllImport ("clutter")]
+ private static extern void clutter_stage_get_color (IntPtr handle, out Color color);
+
+ public Color Color {
+ get {
+ Color color = Color.Zero;
+ clutter_stage_get_color (Handle, out color);
+ return color;
+ }
+
+ set { clutter_stage_set_color (Handle, ref value); }
+ }
+
+ [DllImport ("clutter")]
+ private static extern IntPtr clutter_stage_get_type ();
+
+ public static new GLib.GType GType {
+ get { return new GLib.GType (clutter_stage_get_type ()); }
+ }
+ }
+}
Added: trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Texture.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Clutter/Texture.cs Sun Jan 25 03:03:09 2009
@@ -0,0 +1,71 @@
+//
+// Texture.cs
+//
+// Author:
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2009 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Clutter
+{
+ public class Texture : Actor
+ {
+ public Texture (IntPtr raw) : base (raw)
+ {
+ }
+
+ public Texture () : base (IntPtr.Zero)
+ {
+ CreateNativeObject (new string[0], new GLib.Value[0]);
+ }
+
+ [GLib.Signal ("size-change")]
+ public event SizeChangeHandler SizeChange {
+ add { GLib.Signal.Lookup (this, "size-change", typeof (SizeChangeArgs)).AddDelegate (value); }
+ remove { GLib.Signal.Lookup (this, "size-change", typeof (SizeChangeArgs)).RemoveDelegate (value); }
+ }
+
+ [DllImport ("clutter")]
+ private static extern IntPtr clutter_texture_get_type ();
+
+ public static new GLib.GType GType {
+ get { return new GLib.GType (clutter_texture_get_type ()); }
+ }
+ }
+
+ public delegate void SizeChangeHandler (object o, SizeChangeArgs args);
+
+ public class SizeChangeArgs : GLib.SignalArgs
+ {
+ public int Width {
+ get { return (int)Args[0]; }
+ }
+
+ public int Height {
+ get { return (int)Args[1]; }
+ }
+ }
+}
Added: trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying.Clutter/Makefile.am Sun Jan 25 03:03:09 2009
@@ -0,0 +1,26 @@
+ASSEMBLY = Banshee.NowPlaying.Clutter
+TARGET = library
+LINK = $(REF_EXTENSION_NOWPLAYING_CLUTTER)
+INSTALL_DIR = $(EXTENSIONS_INSTALL_DIR)
+
+SOURCES = \
+ Banshee.NowPlaying.Clutter/NowPlayingInterface.cs \
+ Banshee.NowPlaying.Clutter/NowPlayingSource.cs \
+ Clutter.Gtk/Embed.cs \
+ Clutter/Actor.cs \
+ Clutter/Color.cs \
+ Clutter/Group.cs \
+ Clutter/Stage.cs \
+ Clutter/Texture.cs
+
+RESOURCES = Banshee.NowPlaying.Clutter.addin.xml
+
+if HAVE_CLUTTER
+include $(top_srcdir)/build/build.mk
+module_SCRIPTS += Banshee.NowPlaying.Clutter.dll.config
+EXTRA_DIST += Banshee.NowPlaying.Clutter.dll.config
+else
+EXTRA_DIST = $(SOURCES) $(RESOURCES) Banshee.NowPlaying.Clutter
+endif
+
+
Modified: trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingContents.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingContents.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingContents.cs Sun Jan 25 03:03:09 2009
@@ -44,16 +44,8 @@
{
NoShowAll = true;
- switch (Banshee.ServiceStack.ServiceManager.PlayerEngine.VideoDisplayContextType) {
- case Banshee.MediaEngine.VideoDisplayContextType.GdkWindow:
- video_display = new XOverlayVideoDisplay ();
- break;
- case Banshee.MediaEngine.VideoDisplayContextType.Unsupported:
- default:
- video_display = null;
- break;
- }
-
+ video_display = new XOverlayVideoDisplay ();
+
IVideoDisplay ivideo_display = video_display as IVideoDisplay;
if (ivideo_display != null) {
ivideo_display.IdleStateChanged += OnVideoDisplayIdleStateChanged;
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 Sun Jan 25 03:03:09 2009
@@ -47,6 +47,11 @@
public NowPlayingSource () : base ("now-playing", Catalog.GetString ("Now Playing"), 10)
{
+ if (Banshee.ServiceStack.ServiceManager.PlayerEngine.VideoDisplayContextType !=
+ Banshee.MediaEngine.VideoDisplayContextType.GdkWindow) {
+ throw new ApplicationException ("Unsupported video display context");
+ }
+
TypeUniqueId = "now-playing";
now_playing_interface = new NowPlayingInterface ();
Modified: trunk/banshee/src/Extensions/Makefile.am
==============================================================================
--- trunk/banshee/src/Extensions/Makefile.am (original)
+++ trunk/banshee/src/Extensions/Makefile.am Sun Jan 25 03:03:09 2009
@@ -12,6 +12,7 @@
Banshee.MultimediaKeys \
Banshee.NotificationArea \
Banshee.NowPlaying \
+ Banshee.NowPlaying.Clutter \
Banshee.PlayerMigration \
Banshee.PlayQueue \
Banshee.Podcasting \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]