banshee r4247 - in trunk/banshee: . src/Clients/Nereid/Nereid src/Core/Banshee.ThickClient/Banshee.Sources.Gui src/Extensions/Banshee.InternetRadio src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio src/Libraries/Mono.Media
- From: abock svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r4247 - in trunk/banshee: . src/Clients/Nereid/Nereid src/Core/Banshee.ThickClient/Banshee.Sources.Gui src/Extensions/Banshee.InternetRadio src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio src/Libraries/Mono.Media
- Date: Thu, 24 Jul 2008 22:51:16 +0000 (UTC)
Author: abock
Date: Thu Jul 24 22:51:15 2008
New Revision: 4247
URL: http://svn.gnome.org/viewvc/banshee?rev=4247&view=rev
Log:
2008-07-24 Aaron Bockover <abock gnome org>
* src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio/InternetRadioSource.cs:
* src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio/InternetRadioSourceContents.cs:
Temporary hack that provides a Genre browser for Internet Radio
* src/Clients/Nereid/Nereid/PlayerInterface.cs: Support inherited
source contents
* src/Core/Banshee.ThickClient/Banshee.Sources.Gui/ITrackModelSourceContents.cs:
* src/Core/Banshee.ThickClient/Banshee.Sources.Gui/CompositeTrackSourceContents.cs:
Remove unnecessary interface API and disable the genre browser for now
* src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs:
Support forced positioning of the browser
Added:
trunk/banshee/src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio/InternetRadioSourceContents.cs
Modified:
trunk/banshee/ChangeLog
trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs
trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/CompositeTrackSourceContents.cs
trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs
trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/ITrackModelSourceContents.cs
trunk/banshee/src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio.mdp
trunk/banshee/src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio/InternetRadioSource.cs
trunk/banshee/src/Extensions/Banshee.InternetRadio/Makefile.am
trunk/banshee/src/Libraries/Mono.Media/Makefile.am
trunk/banshee/src/Libraries/Mono.Media/Mono.Media.mdp
Modified: trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs
==============================================================================
--- trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs (original)
+++ trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs Thu Jul 24 22:51:15 2008
@@ -342,8 +342,14 @@
}
// Connect the source models to the views if possible
- if (source.Properties.Contains ("Nereid.SourceContents")) {
- view_container.Content = source.Properties.Get<ISourceContents> ("Nereid.SourceContents");
+ ISourceContents contents = source.GetInheritedProperty<bool> ("Nereid.SourceContentsPropagate")
+ ? source.GetInheritedProperty<ISourceContents> ("Nereid.SourceContents")
+ : source.Properties.Get<ISourceContents> ("Nereid.SourceContents");
+
+ if (contents != null) {
+ if (view_container.Content != contents) {
+ view_container.Content = contents;
+ }
view_container.Content.SetSource (source);
view_container.Show ();
} else if (source is ITrackModelSource) {
@@ -366,8 +372,6 @@
if (view_container.Visible && view_container.Content is ITrackModelSourceContents) {
ITrackModelSourceContents track_content = view_container.Content as ITrackModelSourceContents;
source.Properties.Set<IListView<TrackInfo>> ("Track.IListView", track_content.TrackView);
- source.Properties.Set<IListView<ArtistInfo>> ("Artist.IListView", track_content.ArtistView);
- source.Properties.Set<IListView<AlbumInfo>> ("Album.IListView", track_content.AlbumView);
}
view_container.Header.Visible = source.Properties.Contains ("Nereid.SourceContents.HeaderVisible") ?
Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/CompositeTrackSourceContents.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/CompositeTrackSourceContents.cs (original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/CompositeTrackSourceContents.cs Thu Jul 24 22:51:15 2008
@@ -50,7 +50,7 @@
{
public class CompositeTrackSourceContents : FilteredListSourceContents, ITrackModelSourceContents
{
- private QueryFilterView<string> genre_view;
+ // private QueryFilterView<string> genre_view;
private ArtistListView artist_view;
private AlbumListView album_view;
private TrackListView track_view;
@@ -62,19 +62,21 @@
protected override void InitializeViews ()
{
SetupMainView (track_view = new TrackListView ());
- SetupFilterView (genre_view = new QueryFilterView<string> (Catalog.GetString ("Not Set")));
+ // SetupFilterView (genre_view = new QueryFilterView<string> (Catalog.GetString ("Not Set")));
SetupFilterView (artist_view = new ArtistListView ());
SetupFilterView (album_view = new AlbumListView ());
}
protected override void ClearFilterSelections ()
{
- if (genre_view.Model != null) {
- genre_view.Selection.Clear ();
- }
+ // if (genre_view.Model != null) {
+ // genre_view.Selection.Clear ();
+ // }
+
if (artist_view.Model != null) {
artist_view.Selection.Clear ();
}
+
if (album_view.Model != null) {
album_view.Selection.Clear ();
}
@@ -85,44 +87,20 @@
SetModel (track);
SetModel (artist);
SetModel (album);
- SetModel (genre);
+ // SetModel (genre);
}
IListView<TrackInfo> ITrackModelSourceContents.TrackView {
get { return track_view; }
}
-
- IListView<ArtistInfo> ITrackModelSourceContents.ArtistView {
- get { return artist_view; }
- }
-
- IListView<AlbumInfo> ITrackModelSourceContents.AlbumView {
- get { return album_view; }
- }
public TrackListView TrackView {
get { return track_view; }
}
-
- public ArtistListView ArtistView {
- get { return artist_view; }
- }
-
- public AlbumListView AlbumView {
- get { return album_view; }
- }
-
+
public TrackListModel TrackModel {
get { return (TrackListModel)track_view.Model; }
}
-
- public ArtistListModel ArtistModel {
- get { return (ArtistListModel)artist_view.Model; }
- }
-
- public AlbumListModel AlbumModel {
- get { return (AlbumListModel)album_view.Model; }
- }
protected override bool ActiveSourceCanHasBrowser {
get {
@@ -154,10 +132,10 @@
SetModel (artist_view, (model as IListModel<ArtistInfo>));
else if (model is IListModel<AlbumInfo>)
SetModel (album_view, (model as IListModel<AlbumInfo>));
- else if (model is IListModel<QueryFilterInfo<string>>)
- SetModel (genre_view, (model as IListModel<QueryFilterInfo<string>>));
- else
- Hyena.Log.DebugFormat ("CompositeTrackSourceContents got non-album/artist filter model: {0}", model);
+ // else if (model is IListModel<QueryFilterInfo<string>>)
+ // SetModel (genre_view, (model as IListModel<QueryFilterInfo<string>>));
+ // else
+ // Hyena.Log.DebugFormat ("CompositeTrackSourceContents got non-album/artist filter model: {0}", model);
}
}
@@ -171,7 +149,7 @@
track_view.SetModel (null);
artist_view.SetModel (null);
album_view.SetModel (null);
- genre_view.SetModel (null);
+ // genre_view.SetModel (null);
track_view.HeaderVisible = false;
}
Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs (original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs Thu Jul 24 22:51:15 2008
@@ -86,14 +86,18 @@
{
this.name = name;
InitializeViews ();
-
- string position = BrowserPosition.Get ();
+
+ string position = ForcePosition == null ? BrowserPosition.Get () : ForcePosition;
if (position == "top") {
LayoutTop ();
} else {
LayoutLeft ();
}
+ if (ForcePosition != null) {
+ return;
+ }
+
if (ServiceManager.Contains ("InterfaceActionService")) {
action_service = ServiceManager.Get<InterfaceActionService> ();
@@ -262,7 +266,7 @@
NoShowAll = false;
ShowAll ();
NoShowAll = true;
- browser_container.Visible = BrowserVisible.Get ();
+ browser_container.Visible = ForcePosition != null || BrowserVisible.Get ();
}
private void OnViewModeChanged (object o, ChangedArgs args)
@@ -339,6 +343,10 @@
return null;
}
+
+ protected virtual string ForcePosition {
+ get { return null; }
+ }
protected abstract bool ActiveSourceCanHasBrowser { get; }
Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/ITrackModelSourceContents.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/ITrackModelSourceContents.cs (original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/ITrackModelSourceContents.cs Thu Jul 24 22:51:15 2008
@@ -38,7 +38,5 @@
public interface ITrackModelSourceContents : ISourceContents
{
IListView<TrackInfo> TrackView { get; }
- IListView<ArtistInfo> ArtistView { get; }
- IListView<AlbumInfo> AlbumView { get; }
}
}
Modified: trunk/banshee/src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio.mdp
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio.mdp (original)
+++ trunk/banshee/src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio.mdp Thu Jul 24 22:51:15 2008
@@ -1,4 +1,4 @@
-<Project name="Banshee.InternetRadio" fileversion="2.0" language="C#" clr-version="Net_2_0" UseParentDirectoryAsNamespace="True" ctype="DotNetProject">
+<Project name="Banshee.InternetRadio" fileversion="2.0" language="C#" UseParentDirectoryAsNamespace="True" clr-version="Net_2_0" ctype="DotNetProject">
<Configurations active="Debug">
<Configuration name="Debug" ctype="DotNetProjectConfiguration">
<Output directory="../../../bin" assemblyKeyFile="." assembly="Banshee.InternetRadio" />
@@ -14,6 +14,7 @@
<File name="Banshee.InternetRadio/InternetRadioSource.cs" subtype="Code" buildaction="Compile" />
<File name="Banshee.InternetRadio/StationEditor.cs" subtype="Code" buildaction="Compile" />
<File name="Banshee.InternetRadio/XspfMigrator.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.InternetRadio/InternetRadioSourceContents.cs" subtype="Code" buildaction="Compile" />
</Contents>
<References>
<ProjectReference type="Project" localcopy="True" refto="Banshee.Core" />
Modified: trunk/banshee/src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio/InternetRadioSource.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio/InternetRadioSource.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio/InternetRadioSource.cs Thu Jul 24 22:51:15 2008
@@ -51,6 +51,7 @@
get { return "internet-radio"; }
}
+ private InternetRadioSourceContents source_contents;
private uint ui_id;
public InternetRadioSource () : base (Catalog.GetString ("Radio"), Catalog.GetString ("Radio"), "internet-radio", 220)
@@ -74,6 +75,10 @@
Properties.SetString ("ActiveSourceUIResource", "ActiveSourceUI.xml");
Properties.SetString ("GtkActionPath", "/InternetRadioContextMenu");
+ source_contents = new InternetRadioSourceContents ();
+ Properties.Set<bool> ("Nereid.SourceContentsPropagate", true);
+ Properties.Set<ISourceContents> ("Nereid.SourceContents", source_contents);
+
Properties.SetString ("TrackPropertiesActionLabel", Catalog.GetString ("Edit Station"));
Properties.Set<InvokeHandler> ("TrackPropertiesActionHandler", delegate {
if (TrackModel.SelectedItems == null || TrackModel.SelectedItems.Count <= 0) {
@@ -100,13 +105,16 @@
<visible>false</visible>
</column>
<add-default column=""TitleColumn"" />
+ <column modify-default=""TitleColumn"">
+ <title>{0}</title>
+ </column>
<add-default column=""ArtistColumn"" />
<column modify-default=""ArtistColumn"">
- <title>{0}</title>
+ <title>{1}</title>
</column>
<add-default column=""CommentColumn"" />
<column modify-default=""CommentColumn"">
- <title>{1}</title>
+ <title>{2}</title>
</column>
<add-default column=""RatingColumn"" />
<add-default column=""PlayCountColumn"" />
@@ -116,6 +124,7 @@
<add-default column=""UriColumn"" />
<sort-column direction=""asc"">genre</sort-column>
</column-controller>",
+ Catalog.GetString ("Station"),
Catalog.GetString ("Creator"),
Catalog.GetString ("Description")
));
@@ -244,9 +253,8 @@
get { return false; }
}
- // TODO change this to true once the Composite widget is made to work w/ variable number/type of filters
public override bool ShowBrowser {
- get { return false; }
+ get { return true; }
}
public override bool CanRename {
Added: trunk/banshee/src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio/InternetRadioSourceContents.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio/InternetRadioSourceContents.cs Thu Jul 24 22:51:15 2008
@@ -0,0 +1,112 @@
+//
+// InternetRadioSourceContents.cs
+//
+// Author:
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2008 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 Hyena.Data;
+using Hyena.Data.Gui;
+
+using Banshee.Base;
+using Banshee.Configuration;
+
+using Banshee.Sources;
+using Banshee.Sources.Gui;
+using Banshee.ServiceStack;
+
+using Banshee.Collection;
+using Banshee.Collection.Database;
+using Banshee.Collection.Gui;
+
+namespace Banshee.InternetRadio
+{
+ public class InternetRadioSourceContents : FilteredListSourceContents
+ {
+ private TrackListView track_view;
+ private QueryFilterView<string> genre_view;
+
+ public InternetRadioSourceContents () : base ("iradio")
+ {
+ }
+
+ protected override void InitializeViews ()
+ {
+ SetupMainView (track_view = new TrackListView ());
+ SetupFilterView (genre_view = new QueryFilterView<string> (Catalog.GetString ("Not Set")));
+ }
+
+ protected override void ClearFilterSelections ()
+ {
+ if (genre_view.Model != null) {
+ genre_view.Selection.Clear ();
+ }
+ }
+
+ protected override bool ActiveSourceCanHasBrowser {
+ get { return true; }
+ }
+
+ protected override string ForcePosition {
+ get { return "left"; }
+ }
+
+#region Implement ISourceContents
+
+ public override bool SetSource (ISource source)
+ {
+ DatabaseSource track_source = source as DatabaseSource;
+ if (track_source == null) {
+ return false;
+ }
+
+ base.source = source;
+
+ SetModel (track_view, track_source.TrackModel);
+
+ foreach (IListModel model in track_source.CurrentFilters) {
+ IListModel<QueryFilterInfo<string>> genre_model = model as IListModel<QueryFilterInfo<string>>;
+ if (genre_model != null) {
+ SetModel (genre_view, genre_model);
+ }
+ }
+
+ return true;
+ }
+
+ public override void ResetSource ()
+ {
+ base.source = null;
+ track_view.SetModel (null);
+ genre_view.SetModel (null);
+ }
+
+#endregion
+ }
+}
Modified: trunk/banshee/src/Extensions/Banshee.InternetRadio/Makefile.am
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.InternetRadio/Makefile.am (original)
+++ trunk/banshee/src/Extensions/Banshee.InternetRadio/Makefile.am Thu Jul 24 22:51:15 2008
@@ -5,6 +5,7 @@
SOURCES = \
Banshee.InternetRadio/InternetRadioSource.cs \
+ Banshee.InternetRadio/InternetRadioSourceContents.cs \
Banshee.InternetRadio/StationEditor.cs \
Banshee.InternetRadio/XspfMigrator.cs
Modified: trunk/banshee/src/Libraries/Mono.Media/Makefile.am
==============================================================================
--- trunk/banshee/src/Libraries/Mono.Media/Makefile.am (original)
+++ trunk/banshee/src/Libraries/Mono.Media/Makefile.am Thu Jul 24 22:51:15 2008
@@ -2,10 +2,11 @@
TARGET = library
LINK = $(REF_MONO_MEDIA)
-SOURCES = \
+SOURCES = \
Media.Playlists.Xspf/LinkEntry.cs \
Media.Playlists.Xspf/MetaEntry.cs \
Media.Playlists.Xspf/Playlist.cs \
+ Media.Playlists.Xspf/Tests/XspfTests.cs \
Media.Playlists.Xspf/Track.cs \
Media.Playlists.Xspf/W3CDateTime.cs \
Media.Playlists.Xspf/XmlUtil.cs \
Modified: trunk/banshee/src/Libraries/Mono.Media/Mono.Media.mdp
==============================================================================
--- trunk/banshee/src/Libraries/Mono.Media/Mono.Media.mdp (original)
+++ trunk/banshee/src/Libraries/Mono.Media/Mono.Media.mdp Thu Jul 24 22:51:15 2008
@@ -1,4 +1,4 @@
-<Project name="Mono.Media" fileversion="2.0" language="C#" clr-version="Net_2_0" UseParentDirectoryAsNamespace="True" ctype="DotNetProject">
+<Project name="Mono.Media" fileversion="2.0" language="C#" UseParentDirectoryAsNamespace="True" clr-version="Net_2_0" ctype="DotNetProject">
<Configurations active="Debug">
<Configuration name="Debug" ctype="DotNetProjectConfiguration">
<Output directory="." assembly="Mono.Media" />
@@ -22,4 +22,13 @@
<ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Gac" localcopy="True" refto="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</References>
+ <MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="True" RelativeMakefileName="Makefile.am">
+ <BuildFilesVar Sync="True" Name="SOURCES" />
+ <DeployFilesVar />
+ <ResourcesVar />
+ <OthersVar />
+ <GacRefVar />
+ <AsmRefVar />
+ <ProjectRefVar />
+ </MonoDevelop.Autotools.MakefileInfo>
</Project>
\ No newline at end of file
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]