GNOME Bugzilla – Bug 365560
Banshee composer support
Last modified: 2008-10-01 15:06:16 UTC
I'm sure this has been requested before, but Banshee currently lacks support for composer tags, making it extremely difficult to use for organizing classical music.
Created attachment 75487 [details] [review] A patch adding composer support (dialogs, tags, DBus, etc.) I'm not very familiar with the Banshee codebase, so this may be implemented incorrectly. Please review!
Comment on attachment 75487 [details] [review] A patch adding composer support (dialogs, tags, DBus, etc.) Index: data/banshee-dialogs.glade =================================================================== RCS file: /cvs/gnome/banshee/data/banshee-dialogs.glade,v retrieving revision 1.11 diff -u -r1.11 banshee-dialogs.glade --- data/banshee-dialogs.glade 12 Oct 2006 19:20:19 -0000 1.11 +++ data/banshee-dialogs.glade 26 Oct 2006 04:15:19 -0000 @@ -40,7 +40,7 @@ <widget class="GtkTable" id="table1"> <property name="border_width">10</property> <property name="visible">True</property> - <property name="n_rows">9</property> + <property name="n_rows">10</property> <property name="n_columns">4</property> <property name="homogeneous">False</property> <property name="row_spacing">5</property> @@ -68,8 +68,8 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> @@ -97,8 +97,8 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> + <property name="top_attach">6</property> + <property name="bottom_attach">7</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> @@ -126,8 +126,8 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">6</property> - <property name="bottom_attach">7</property> + <property name="top_attach">7</property> + <property name="bottom_attach">8</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> @@ -184,8 +184,8 @@ <packing> <property name="left_attach">0</property> <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> @@ -213,8 +213,8 @@ <packing> <property name="left_attach">0</property> <property name="right_attach">1</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> @@ -242,8 +242,8 @@ <packing> <property name="left_attach">0</property> <property name="right_attach">1</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> + <property name="top_attach">6</property> + <property name="bottom_attach">7</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> @@ -271,8 +271,8 @@ <packing> <property name="left_attach">0</property> <property name="right_attach">1</property> - <property name="top_attach">6</property> - <property name="bottom_attach">7</property> + <property name="top_attach">7</property> + <property name="bottom_attach">8</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> @@ -300,8 +300,8 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> @@ -329,8 +329,8 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> @@ -358,8 +358,8 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> @@ -458,8 +458,8 @@ <packing> <property name="left_attach">2</property> <property name="right_attach">4</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> <property name="y_options"></property> </packing> </child> @@ -522,8 +522,8 @@ <packing> <property name="left_attach">2</property> <property name="right_attach">4</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> <property name="y_options"></property> </packing> </child> @@ -552,8 +552,8 @@ <packing> <property name="left_attach">2</property> <property name="right_attach">4</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> <property name="x_options">fill</property> <property name="y_options">fill</property> </packing> @@ -588,8 +588,8 @@ <packing> <property name="left_attach">2</property> <property name="right_attach">3</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> + <property name="top_attach">6</property> + <property name="bottom_attach">7</property> <property name="y_options"></property> </packing> </child> @@ -623,8 +623,8 @@ <packing> <property name="left_attach">2</property> <property name="right_attach">3</property> - <property name="top_attach">6</property> - <property name="bottom_attach">7</property> + <property name="top_attach">7</property> + <property name="bottom_attach">8</property> <property name="y_options"></property> </packing> </child> @@ -658,8 +658,8 @@ <packing> <property name="left_attach">2</property> <property name="right_attach">3</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> <property name="y_options"></property> </packing> </child> @@ -752,8 +752,8 @@ <packing> <property name="left_attach">0</property> <property name="right_attach">4</property> - <property name="top_attach">8</property> - <property name="bottom_attach">9</property> + <property name="top_attach">9</property> + <property name="bottom_attach">10</property> <property name="x_options"></property> <property name="y_options"></property> </packing> @@ -781,8 +781,8 @@ <packing> <property name="left_attach">3</property> <property name="right_attach">4</property> - <property name="top_attach">4</property> - <property name="bottom_attach">6</property> + <property name="top_attach">5</property> + <property name="bottom_attach">7</property> <property name="x_options">fill</property> <property name="y_options">fill</property> </packing> @@ -810,8 +810,8 @@ <packing> <property name="left_attach">0</property> <property name="right_attach">1</property> - <property name="top_attach">7</property> - <property name="bottom_attach">8</property> + <property name="top_attach">8</property> + <property name="bottom_attach">9</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> @@ -838,8 +838,8 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">7</property> - <property name="bottom_attach">8</property> + <property name="top_attach">8</property> + <property name="bottom_attach">9</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> @@ -872,10 +872,73 @@ <packing> <property name="left_attach">2</property> <property name="right_attach">3</property> - <property name="top_attach">7</property> - <property name="bottom_attach">8</property> + <property name="top_attach">8</property> + <property name="bottom_attach">9</property> <property name="x_options">fill</property> <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkAlignment" id="alignment31"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">10</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkEntry" id="Composer"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">*</property> + <property name="activates_default">False</property> + </widget> + </child> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label91"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>C_omposer:</b></property> + <property name="use_underline">True</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options"></property> </packing> </child> </widget> Index: data/banshee.schemas.in =================================================================== RCS file: /cvs/gnome/banshee/data/banshee.schemas.in,v retrieving revision 1.18 diff -u -r1.18 banshee.schemas.in --- data/banshee.schemas.in 12 Jul 2006 21:12:15 -0000 1.18 +++ data/banshee.schemas.in 26 Oct 2006 04:15:19 -0000 @@ -189,6 +189,28 @@ </locale> </schema> <schema> + <key>/schemas/apps/Banshee/PlaylistColumns/Composer/Width</key> + <applyto>/apps/Banshee/PlaylistColumns/Composer/Width</applyto> + <owner>banshee</owner> + <type>int</type> + <default>165</default> + <locale name="C"> + <short>Width of Composer Column.</short> + <long>Width of Composer Column.</long> + </locale> + </schema> + <schema> + <key>/schemas/apps/Banshee/PlaylistColumns/Composer/Visible</key> + <applyto>/apps/Banshee/PlaylistColumns/Composer/Visible</applyto> + <owner>banshee</owner> + <type>bool</type> + <default>true</default> + <locale name="C"> + <short>Visibility of Composer Column.</short> + <long>Visibility of Composer Column.</long> + </locale> + </schema> + <schema> <key>/schemas/apps/Banshee/PlaylistColumns/Last-Played/Width</key> <applyto>/apps/Banshee/PlaylistColumns/Last-Played/Width</applyto> <owner>banshee</owner> Index: src/Main.cs =================================================================== RCS file: /cvs/gnome/banshee/src/Main.cs,v retrieving revision 1.45 diff -u -r1.45 Main.cs --- src/Main.cs 22 Oct 2006 23:31:50 -0000 1.45 +++ src/Main.cs 26 Oct 2006 04:15:20 -0000 @@ -68,6 +68,7 @@ new ArgumentLayout("pause", "Pause current song"), new ArgumentLayout("shutdown", "Shutdown Banshee"), new ArgumentLayout("query-artist", "Get artist name for current playing song"), + new ArgumentLayout("query-composer", "Get composer name for current playing song"), new ArgumentLayout("query-album", "Get album name for current playing song"), new ArgumentLayout("query-title", "Get track title for current playing song"), new ArgumentLayout("query-genre", "Get track genre for current playing song"), @@ -168,6 +169,10 @@ break; case "query-artist": PrintQueryResult("Artist", remote_player.GetPlayingArtist()); + present = false; + break; + case "query-composer": + PrintQueryResult("Composer", remote_player.GetPlayingComposer()); present = false; break; case "query-album": Index: src/PlayerInterface.cs =================================================================== RCS file: /cvs/gnome/banshee/src/PlayerInterface.cs,v retrieving revision 1.225 diff -u -r1.225 PlayerInterface.cs --- src/PlayerInterface.cs 24 Oct 2006 23:14:28 -0000 1.225 +++ src/PlayerInterface.cs 26 Oct 2006 04:15:22 -0000 @@ -444,6 +444,7 @@ fields.Add("-"); fields.Add(Catalog.GetString("Song Name")); fields.Add(Catalog.GetString("Artist Name")); + fields.Add(Catalog.GetString("Composer Name")); fields.Add(Catalog.GetString("Album Title")); fields.Add(Catalog.GetString("Genre")); fields.Add(Catalog.GetString("Year")); @@ -638,12 +639,13 @@ } trackInfoHeader.Artist = track.DisplayArtist; + trackInfoHeader.Composer = track.DisplayComposer; trackInfoHeader.Title = track.DisplayTitle; trackInfoHeader.Album = track.DisplayAlbum; trackInfoHeader.Visible = true; - WindowPlayer.Title = track.DisplayTitle + " (" + track.DisplayArtist + ")"; + WindowPlayer.Title = track.DisplayTitle + " (" + (track.Composer == null ? track.DisplayArtist : track.Composer) + ")"; try { trackInfoHeader.Cover.FileName = track.CoverArtFileName; @@ -1239,6 +1241,8 @@ if(field == Catalog.GetString("Artist Name")) { matches = new string [] { ti.Artist }; + } else if(field == Catalog.GetString("Composer Name")) { + matches = new string [] { ti.Composer }; } else if(field == Catalog.GetString("Song Name")) { matches = new string [] { ti.Title }; } else if(field == Catalog.GetString("Album Title")) { @@ -1250,6 +1254,7 @@ } else { matches = new string [] { ti.Artist, + ti.Composer, ti.Album, ti.Title, ti.Genre, @@ -2203,6 +2208,7 @@ private enum SearchTrackCriteria { Artist, + Composer, Album, Genre } @@ -2217,6 +2223,11 @@ SearchBySelectedTrack(SearchTrackCriteria.Artist); } + private void OnSearchForSameComposerAction(object o, EventArgs args) + { + SearchBySelectedTrack(SearchTrackCriteria.Composer); + } + private void OnSearchForSameGenreAction(object o, EventArgs args) { SearchBySelectedTrack(SearchTrackCriteria.Genre); @@ -2245,6 +2256,10 @@ case SearchTrackCriteria.Artist: searchEntry.Field = Catalog.GetString("Artist Name"); searchEntry.Query = track.Artist; + break; + case SearchTrackCriteria.Composer: + searchEntry.Field = Catalog.GetString("Composer Name"); + searchEntry.Query = track.Composer; break; case SearchTrackCriteria.Genre: searchEntry.Field = Catalog.GetString("Genre"); Index: src/PlaylistView.cs =================================================================== RCS file: /cvs/gnome/banshee/src/PlaylistView.cs,v retrieving revision 1.56 diff -u -r1.56 PlaylistView.cs --- src/PlaylistView.cs 25 Sep 2006 19:15:14 -0000 1.56 +++ src/PlaylistView.cs 26 Oct 2006 04:15:22 -0000 @@ -55,6 +55,7 @@ private enum ColumnId : int { Track, Artist, + Composer, Title, Album, Genre, @@ -102,42 +103,45 @@ columns.Add(new PlaylistColumn(this, Catalog.GetString("Artist"), "Artist", new TreeCellDataFunc(TrackCellArtist), new CellRendererText(), 1, (int)ColumnId.Artist)); + columns.Add(new PlaylistColumn(this, Catalog.GetString("Composer"), "Composer", + new TreeCellDataFunc(TrackCellComposer), new CellRendererText(), + 2, (int)ColumnId.Composer)); columns.Add(new PlaylistColumn(this, Catalog.GetString("Title"), "Title", new TreeCellDataFunc(TrackCellTitle), new CellRendererText(), - 2, (int)ColumnId.Title)); + 3, (int)ColumnId.Title)); columns.Add(new PlaylistColumn(this, Catalog.GetString("Album"), "Album", new TreeCellDataFunc(TrackCellAlbum), new CellRendererText(), - 3, (int)ColumnId.Album)); + 4, (int)ColumnId.Album)); columns.Add(new PlaylistColumn(this, Catalog.GetString("Genre"), "Genre", new TreeCellDataFunc(TrackCellGenre), new CellRendererText(), - 4, (int)ColumnId.Genre)); + 5, (int)ColumnId.Genre)); columns.Add(new PlaylistColumn(this, Catalog.GetString("Year"), "Year", new TreeCellDataFunc(TrackCellYear), new CellRendererText(), - 5, (int)ColumnId.Year)); + 6, (int)ColumnId.Year)); columns.Add(new PlaylistColumn(this, Catalog.GetString("Time"), "Time", new TreeCellDataFunc(TrackCellTime), new CellRendererText(), - 6, (int)ColumnId.Time)); + 7, (int)ColumnId.Time)); rating_renderer = new Banshee.Gui.CellRendererRating(); rating_renderer.RatingChanged += OnRatingChanged; RatingColumn = new PlaylistColumn(this, Catalog.GetString("Rating"), "Rating", new TreeCellDataFunc(TrackCellRating), rating_renderer, - 7, (int)ColumnId.Rating); + 8, (int)ColumnId.Rating); columns.Add(RatingColumn); PlaysColumn = new PlaylistColumn(this, Catalog.GetString("Plays"), "Plays", new TreeCellDataFunc(TrackCellPlayCount), new CellRendererText(), - 8, (int)ColumnId.PlayCount); + 9, (int)ColumnId.PlayCount); columns.Add(PlaysColumn); LastPlayedColumn = new PlaylistColumn(this, Catalog.GetString("Last Played"), "Last-Played", new TreeCellDataFunc(TrackCellLastPlayed), new CellRendererText(), - 9, (int)ColumnId.LastPlayed); + 10, (int)ColumnId.LastPlayed); columns.Add(LastPlayedColumn); columns.Sort(new ColumnSorter()); @@ -196,9 +200,11 @@ Selection.Mode = SelectionMode.Multiple; model.SetSortFunc((int)ColumnId.Track, - new TreeIterCompareFunc(TrackTreeIterCompareFunc)); + new TreeIterCompareFunc(TrackTreeIterCompareFunc)); model.SetSortFunc((int)ColumnId.Artist, new TreeIterCompareFunc(ArtistTreeIterCompareFunc)); + model.SetSortFunc((int)ColumnId.Composer, + new TreeIterCompareFunc(ComposerTreeIterCompareFunc)); model.SetSortFunc((int)ColumnId.Title, new TreeIterCompareFunc(TitleTreeIterCompareFunc)); model.SetSortFunc((int)ColumnId.Album, @@ -282,6 +288,18 @@ return AlbumTreeIterCompareFunc(_model, a, b); } + + public int ComposerTreeIterCompareFunc(TreeModel _model, TreeIter a, + TreeIter b) + { + int v = StringFieldCompare(model.IterTrackInfo(a).Composer, + model.IterTrackInfo(b).Composer); + + if(v != 0) + return v; + + return AlbumTreeIterCompareFunc(_model, a, b); + } public int TitleTreeIterCompareFunc(TreeModel _model, TreeIter a, TreeIter b) @@ -469,6 +487,16 @@ } SetRendererAttributes((CellRendererText)cell, ti.Artist, iter); + } + + protected void TrackCellComposer(TreeViewColumn tree_column, + CellRenderer cell, TreeModel tree_model, TreeIter iter) + { + TrackInfo ti = model.IterTrackInfo(iter); + if(ti == null) + return; + + SetRendererAttributes((CellRendererText)cell, ti.Composer, iter); } protected void TrackCellTitle(TreeViewColumn tree_column, Index: src/Banshee.Base/ActionManager.cs =================================================================== RCS file: /cvs/gnome/banshee/src/Banshee.Base/ActionManager.cs,v retrieving revision 1.28 diff -u -r1.28 ActionManager.cs --- src/Banshee.Base/ActionManager.cs 23 Oct 2006 04:44:22 -0000 1.28 +++ src/Banshee.Base/ActionManager.cs 26 Oct 2006 04:15:23 -0000 @@ -235,6 +235,10 @@ Catalog.GetString("By matching artist"), null, Catalog.GetString("Search all songs of this artist"), null), + new ActionEntry("SearchForSameComposerAction", null, + Catalog.GetString("By matching composer"), null, + Catalog.GetString("Search all songs of this composer"), null), + new ActionEntry("SearchForSameGenreAction", null, Catalog.GetString("By matching genre"), null, Catalog.GetString("Search all songs of this genre"), null), Index: src/Banshee.Base/DBusPlayer.cs =================================================================== RCS file: /cvs/gnome/banshee/src/Banshee.Base/DBusPlayer.cs,v retrieving revision 1.9 diff -u -r1.9 DBusPlayer.cs --- src/Banshee.Base/DBusPlayer.cs 29 Sep 2006 11:01:45 -0000 1.9 +++ src/Banshee.Base/DBusPlayer.cs 26 Oct 2006 04:15:23 -0000 @@ -50,6 +50,7 @@ void SelectDap(string device); void EnqueueFiles(string [] files); string GetPlayingArtist(); + string GetPlayingComposer(); string GetPlayingAlbum(); string GetPlayingTitle(); string GetPlayingGenre(); @@ -243,6 +244,11 @@ public string GetPlayingArtist() { return HaveTrack ? TrackStringResult(PlayerEngineCore.CurrentTrack.Artist) : String.Empty; + } + + public string GetPlayingComposer() + { + return HaveTrack ? TrackStringResult(PlayerEngineCore.CurrentTrack.Composer): String.Empty; } public string GetPlayingAlbum() Index: src/Banshee.Base/Database.cs =================================================================== RCS file: /cvs/gnome/banshee/src/Banshee.Base/Database.cs,v retrieving revision 1.7 diff -u -r1.7 Database.cs --- src/Banshee.Base/Database.cs 22 May 2006 17:01:49 -0000 1.7 +++ src/Banshee.Base/Database.cs 26 Oct 2006 04:15:23 -0000 @@ -51,6 +51,7 @@ MimeType TEXT, Artist TEXT, + Composer TEXT, Performer TEXT, AlbumTitle TEXT, ReleaseDate Date, Index: src/Banshee.Base/FileTrackInfo.cs =================================================================== RCS file: /cvs/gnome/banshee/src/Banshee.Base/FileTrackInfo.cs,v retrieving revision 1.6 diff -u -r1.6 FileTrackInfo.cs --- src/Banshee.Base/FileTrackInfo.cs 24 Aug 2006 16:35:50 -0000 1.6 +++ src/Banshee.Base/FileTrackInfo.cs 26 Oct 2006 04:15:23 -0000 @@ -52,6 +52,7 @@ TagLib.File file = TagLib.File.Create(uri.LocalPath); artist = Choose(file.Tag.JoinedArtists, artist); + composer = Choose(file.Tag.JoinedComposers, composer); album = Choose(file.Tag.Album, album); title = Choose(file.Tag.Title, title); genre = Choose(file.Tag.FirstGenre, genre); Index: src/Banshee.Base/LibraryTrackInfo.cs =================================================================== RCS file: /cvs/gnome/banshee/src/Banshee.Base/LibraryTrackInfo.cs,v retrieving revision 1.15 diff -u -r1.15 LibraryTrackInfo.cs --- src/Banshee.Base/LibraryTrackInfo.cs 20 Oct 2006 21:47:19 -0000 1.15 +++ src/Banshee.Base/LibraryTrackInfo.cs 26 Oct 2006 04:15:24 -0000 @@ -152,9 +152,10 @@ return null; } - public LibraryTrackInfo(SafeUri uri, string artist, string album, - string title, string genre, uint track_number, uint track_count, - int year, TimeSpan duration, string asin, RemoteLookupStatus remote_lookup_status) + public LibraryTrackInfo(SafeUri uri, string artist, string composer, + string album, string title, string genre, uint track_number, + uint track_count, int year, TimeSpan duration, string asin, + RemoteLookupStatus remote_lookup_status) { this.uri = uri; track_id = 0; @@ -162,6 +163,7 @@ mimetype = null; this.artist = artist; + this.composer = composer; this.album = album; this.title = title; this.genre = genre; @@ -183,9 +185,9 @@ } public LibraryTrackInfo(SafeUri uri, TrackInfo track) : this( - uri, track.Artist, track.Album, track.Title, track.Genre, - track.TrackNumber, track.TrackCount, track.Year, track.Duration, - track.Asin, track.RemoteLookupStatus) + uri, track.Artist, track.Composer, track.Album, track.Title, + track.Genre, track.TrackNumber, track.TrackCount, track.Year, + track.Duration, track.Asin, track.RemoteLookupStatus) { } @@ -216,6 +218,7 @@ private void ParseUri(string path) { artist = String.Empty; + composer = String.Empty; album = String.Empty; title = String.Empty; track_number = 0; @@ -356,6 +359,7 @@ "Uri", uri.AbsoluteUri, "MimeType", mimetype, "Artist", artist, + "Composer", composer, "Performer", performer, "AlbumTitle", album, "ASIN", asin, @@ -418,6 +422,7 @@ album = reader["AlbumTitle"] as string; artist = reader["Artist"] as string; + composer = reader["Composer"] as string; performer = reader["Performer"] as string; title = reader["Title"] as string; genre = reader["Genre"] as string; Index: src/Banshee.Base/StreamTagger.cs =================================================================== RCS file: /cvs/gnome/banshee/src/Banshee.Base/StreamTagger.cs,v retrieving revision 1.5 diff -u -r1.5 StreamTagger.cs --- src/Banshee.Base/StreamTagger.cs 28 Aug 2006 19:51:13 -0000 1.5 +++ src/Banshee.Base/StreamTagger.cs 26 Oct 2006 04:15:24 -0000 @@ -93,6 +93,7 @@ public static void TrackInfoMerge(TrackInfo track, TagLib.File file) { track.Artist = Choose(file.Tag.JoinedArtists, track.Artist); + track.Composer = Choose(file.Tag.JoinedComposers, track.Composer); track.Album = Choose(file.Tag.Album, track.Album); track.Title = Choose(file.Tag.Title, track.Title); track.Genre = Choose(file.Tag.FirstGenre, track.Genre); @@ -113,6 +114,9 @@ case CommonTags.Artist: track.Artist = Choose((string)tag.Value, track.Artist); break; + case CommonTags.Composer: + track.Composer = Choose((string)tag.Value, track.Composer); + break; case CommonTags.Title: track.Title = Choose((string)tag.Value, track.Title); break; @@ -167,6 +171,7 @@ TagLib.File file = StreamTagger.ProcessUri(track.Uri); file.Tag.Artists = new string [] { track.Artist }; + file.Tag.Composers = new string [] { track.Composer }; file.Tag.Album = track.Album; file.Tag.Genres = new string [] { track.Genre }; file.Tag.Title = track.Title; @@ -181,6 +186,7 @@ { public const string Title = "title"; public const string Artist = "artist"; + public const string Composer = "composer"; public const string Album = "album"; public const string Date = "date"; public const string Genre = "genre"; Index: src/Banshee.Base/TrackInfo.cs =================================================================== RCS file: /cvs/gnome/banshee/src/Banshee.Base/TrackInfo.cs,v retrieving revision 1.14 diff -u -r1.14 TrackInfo.cs --- src/Banshee.Base/TrackInfo.cs 6 Jul 2006 19:32:34 -0000 1.14 +++ src/Banshee.Base/TrackInfo.cs 26 Oct 2006 04:15:24 -0000 @@ -51,6 +51,7 @@ protected SafeUri uri; protected string mimetype; protected string artist; + protected string composer; protected string album; protected string title; protected DateTime date_added; @@ -222,6 +223,17 @@ WriteUpdate(); } } + + public string Composer { + get { + return composer; + } + + set { + composer = value; + WriteUpdate(); + } + } public string Album { get { @@ -385,6 +397,14 @@ } } + public string DisplayComposer { + get { + return composer == null || composer == String.Empty + ? Catalog.GetString("Unknown Composer") + : composer; + } + } + public string DisplayAlbum { get { return album == null || album == String.Empty @@ -437,12 +457,12 @@ } TrackInfo t = o as TrackInfo; - return t.Artist == Artist && t.Album == Album && t.Title == Title; + return t.Artist == Artist && t.Composer == Composer && t.Album == Album && t.Title == Title; } public override int GetHashCode() { - return Artist.GetHashCode() ^ Album.GetHashCode() ^ Title.GetHashCode(); + return Artist.GetHashCode() ^ Composer.GetHashCode() ^ Album.GetHashCode() ^ Title.GetHashCode(); } } } Index: src/Banshee.Base/TrackInfoHeader.cs =================================================================== RCS file: /cvs/gnome/banshee/src/Banshee.Base/TrackInfoHeader.cs,v retrieving revision 1.7 diff -u -r1.7 TrackInfoHeader.cs --- src/Banshee.Base/TrackInfoHeader.cs 21 Sep 2006 18:43:17 -0000 1.7 +++ src/Banshee.Base/TrackInfoHeader.cs 26 Oct 2006 04:15:24 -0000 @@ -36,6 +36,7 @@ public class TrackInfoHeader : HBox { private string artist; + private string composer; private string album; private string title; @@ -108,6 +109,13 @@ public string Artist { set { artist = value; + UpdateDisplay(); + } + } + + public string Composer { + set { + composer = value; UpdateDisplay(); } } Index: src/Banshee.Base/TrackInfoPopup.cs =================================================================== RCS file: /cvs/gnome/banshee/src/Banshee.Base/TrackInfoPopup.cs,v retrieving revision 1.6 diff -u -r1.6 TrackInfoPopup.cs --- src/Banshee.Base/TrackInfoPopup.cs 21 Sep 2006 18:43:17 -0000 1.6 +++ src/Banshee.Base/TrackInfoPopup.cs 26 Oct 2006 04:15:24 -0000 @@ -120,6 +120,13 @@ UpdateSize(); } } + + public string Composer { + set { + header.Composer = value; + UpdateSize(); + } + } public string Album { set { Index: src/Banshee.Base/Utilities.cs =================================================================== RCS file: /cvs/gnome/banshee/src/Banshee.Base/Utilities.cs,v retrieving revision 1.20 diff -u -r1.20 Utilities.cs --- src/Banshee.Base/Utilities.cs 21 Jun 2006 05:55:52 -0000 1.20 +++ src/Banshee.Base/Utilities.cs 26 Oct 2006 04:15:25 -0000 @@ -411,7 +411,7 @@ artist = null; } } - + if(track.Album != null) { album = track.Album.Trim(); if(album == String.Empty) { Index: src/Banshee.Base/AudioCd/AudioCdDisk.cs =================================================================== RCS file: /cvs/gnome/banshee/src/Banshee.Base/AudioCd/AudioCdDisk.cs,v retrieving revision 1.14 diff -u -r1.14 AudioCdDisk.cs --- src/Banshee.Base/AudioCd/AudioCdDisk.cs 26 Sep 2006 06:25:19 -0000 1.14 +++ src/Banshee.Base/AudioCd/AudioCdDisk.cs 26 Oct 2006 04:15:25 -0000 @@ -84,6 +84,7 @@ track.Duration = new TimeSpan(mb_track.Length * TimeSpan.TicksPerSecond); track.TrackIndex = mb_track.Index; track.Artist = Catalog.GetString("Unknown Artist"); + track.Composer = Catalog.GetString("Unknown Composer"); track.Album = Catalog.GetString("Unknown Album"); track.Title = String.Format(Catalog.GetString("Track {0}"), mb_track.Index); @@ -158,7 +159,7 @@ if(mb_disc[i].Artist != null) { tracks[i].Artist = mb_disc[i].Artist; } - + if(mb_disc.AlbumName != null) { tracks[i].Album = mb_disc.AlbumName; } Index: src/Banshee.Base/Banshee.SmartPlaylist/Editor.cs =================================================================== RCS file: /cvs/gnome/banshee/src/Banshee.Base/Banshee.SmartPlaylist/Editor.cs,v retrieving revision 1.5 diff -u -r1.5 Editor.cs --- src/Banshee.Base/Banshee.SmartPlaylist/Editor.cs 20 Oct 2006 21:59:56 -0000 1.5 +++ src/Banshee.Base/Banshee.SmartPlaylist/Editor.cs 26 Oct 2006 04:15:25 -0000 @@ -123,6 +123,7 @@ QueryFilter FilterIs = QueryFilter.Is; condition_candidates.Add (FilterContains.Operator.FormatValues (true, "Artist", query, null) ); + condition_candidates.Add (FilterContains.Operator.FormatValues (true, "Composer", query, null) ); condition_candidates.Add (FilterContains.Operator.FormatValues (true, "Title", query, null) ); condition_candidates.Add (FilterContains.Operator.FormatValues (true, "AlbumTitle", query, null) ); condition_candidates.Add (FilterContains.Operator.FormatValues (true, "Genre", query, null) ); @@ -139,14 +140,16 @@ if(field == Catalog.GetString("Artist Name")) { condition = " (" + condition_candidates[0].ToString() + ") "; - } else if(field == Catalog.GetString("Song Name")) { + } else if(field == Catalog.GetString("Composer Name")) { condition = " (" + condition_candidates[1].ToString() + ") "; - } else if(field == Catalog.GetString("Album Title")) { + } else if(field == Catalog.GetString("Song Name")) { condition = " (" + condition_candidates[2].ToString() + ") "; - } else if(field == Catalog.GetString("Genre")) { + } else if(field == Catalog.GetString("Album Title")) { condition = " (" + condition_candidates[3].ToString() + ") "; - } else if(field == Catalog.GetString("Year")) { + } else if(field == Catalog.GetString("Genre")) { condition = " (" + condition_candidates[4].ToString() + ") "; + } else if(field == Catalog.GetString("Year")) { + condition = " (" + condition_candidates[5].ToString() + ") "; } else { // Searching for all possible conditions for(int i = 0; i < condition_candidates.Count; i++) { Index: src/Banshee.Base/Banshee.SmartPlaylist/QueryBuilderModel.cs =================================================================== RCS file: /cvs/gnome/banshee/src/Banshee.Base/Banshee.SmartPlaylist/QueryBuilderModel.cs,v retrieving revision 1.3 diff -u -r1.3 QueryBuilderModel.cs --- src/Banshee.Base/Banshee.SmartPlaylist/QueryBuilderModel.cs 20 Oct 2006 23:52:27 -0000 1.3 +++ src/Banshee.Base/Banshee.SmartPlaylist/QueryBuilderModel.cs 26 Oct 2006 04:15:26 -0000 @@ -44,6 +44,7 @@ public static string Random = Catalog.GetString("Random"); public static string Album = Catalog.GetString("Album"); public static string Artist = Catalog.GetString("Artist"); + public static string Composer = Catalog.GetString("Composer"); public static string Genre = Catalog.GetString("Genre"); public static string SongName = Catalog.GetString("Title"); public static string HighestRating = Catalog.GetString("Highest Rating"); @@ -704,6 +705,7 @@ public TracksQueryModel() : base() { AddField(Catalog.GetString("Artist"), "Artist", typeof(QueryMatchString)); + AddField(Catalog.GetString("Composer"), "Composer", typeof(QueryMatchString)); AddField(Catalog.GetString("Title"), "Title", typeof(QueryMatchString)); AddField(Catalog.GetString("Album"), "AlbumTitle", typeof(QueryMatchString)); AddField(Catalog.GetString("Genre"), "Genre", typeof(QueryMatchString)); @@ -719,6 +721,7 @@ AddOrder(QuerySelectedByCriteria.Random, "RANDOM()"); AddOrder(QuerySelectedByCriteria.Album, "AlbumTitle"); AddOrder(QuerySelectedByCriteria.Artist, "Artist"); + AddOrder(QuerySelectedByCriteria.Composer, "Composer"); AddOrder(QuerySelectedByCriteria.Genre, "Genre"); AddOrder(QuerySelectedByCriteria.SongName, "Title"); AddOrder(QuerySelectedByCriteria.HighestRating, "Rating DESC"); Index: src/Banshee.Base/Gui/TrackEditor.cs =================================================================== RCS file: /cvs/gnome/banshee/src/Banshee.Base/Gui/TrackEditor.cs,v retrieving revision 1.10 diff -u -r1.10 TrackEditor.cs --- src/Banshee.Base/Gui/TrackEditor.cs 17 Sep 2006 23:27:40 -0000 1.10 +++ src/Banshee.Base/Gui/TrackEditor.cs 26 Oct 2006 04:15:26 -0000 @@ -42,6 +42,7 @@ private TrackInfo track; public string Artist; + public string Composer; public string Album; public string Title; public string Genre; @@ -72,6 +73,7 @@ public void Revert() { Artist = track.Artist == null ? String.Empty : track.Artist; + Composer = track.Composer == null ? String.Empty : track.Composer; Album = track.Album == null ? String.Empty : track.Album; Title = track.Title == null ? String.Empty : track.Title; Genre = track.Genre == null ? String.Empty : track.Genre; @@ -85,6 +87,7 @@ public void Save() { track.Artist = Artist; + track.Composer = Composer; track.Album = Album; track.Title = Title; track.Genre = Genre; @@ -118,6 +121,7 @@ [Widget] private SpinButton TrackNumber; [Widget] private Entry Year; [Widget] private Entry Artist; + [Widget] private Entry Composer; [Widget] private Entry Album; [Widget] private Entry Title; [Widget] private ComboBoxEntry Genre; @@ -178,6 +182,7 @@ CoverButton.Clicked += OnCoverButtonClicked; Artist.Changed += OnValueEdited; + Composer.Changed += OnValueEdited; Album.Changed += OnValueEdited; Title.Changed += OnValueEdited; Title.Activated += OnTitleActivated; @@ -260,6 +265,7 @@ rating_entry.Value = (int)track.Rating; (Glade["Artist"] as Entry).Text = track.Artist; + (Glade["Composer"] as Entry).Text = track.Composer; (Glade["Album"] as Entry).Text = track.Album; (Glade["Title"] as Entry).Text = track.Title; (Glade["Genre"] as ComboBoxEntry).Entry.Text = track.Genre; @@ -526,6 +532,7 @@ track.TrackNumber = (uint)TrackNumber.Value; track.TrackCount = (uint)TrackCount.Value; track.Artist = Artist.Text; + track.Composer = Composer.Text; track.Album = Album.Text; track.Title = Title.Text; track.Genre = Genre.Entry.Text; Index: tools/BansheeDBusClient.cs =================================================================== RCS file: /cvs/gnome/banshee/tools/BansheeDBusClient.cs,v retrieving revision 1.5 diff -u -r1.5 BansheeDBusClient.cs --- tools/BansheeDBusClient.cs 29 Sep 2006 11:01:46 -0000 1.5 +++ tools/BansheeDBusClient.cs 26 Oct 2006 04:15:27 -0000 @@ -57,6 +57,7 @@ void SelectDap(string device); void EnqueueFiles(string [] files); string GetPlayingArtist(); + string GetPlayingComposer(); string GetPlayingAlbum(); string GetPlayingTitle(); string GetPlayingGenre(); @@ -111,6 +112,7 @@ private Button next_button; private Label status_label; private Label artist_label; + private Label composer_label; private Label album_label; private Label title_label; @@ -154,11 +156,13 @@ status_label = new Label("Connecting..."); artist_label = new Label(); + composer_label = new Label(); album_label = new Label(); title_label = new Label(); box.PackStart(status_label, false, false, 0); box.PackStart(artist_label, false, false, 0); + box.PackStart(composer_label, false, false, 0); box.PackStart(album_label, false, false, 0); box.PackStart(title_label, false, false, 0); @@ -223,6 +227,7 @@ default: status_label.Markup = "<b>Status:</b> No song loaded"; artist_label.Hide(); + composer_label.Hide(); album_label.Hide(); title_label.Hide(); return true; @@ -236,6 +241,7 @@ Console.WriteLine("Song Changed: {0}", uri); SetField("Artist", banshee.GetPlayingArtist(), artist_label); + SetField("Composer", banshee.GetPlayingComposer(), composer_label); SetField("Album", banshee.GetPlayingAlbum(), album_label); SetField("Title", banshee.GetPlayingTitle(), title_label); }
It looks like this patch was made against CVS. Could you add a patch that uses current SVN? It would have a much better chance of getting attention since we've moved to SVN after you posted this patch. Thanks! Just in case: svn co http://svn.gnome.org/svn/banshee/trunk/banshee
It would also be good if the patch could be attached instead of being a part of the comments. This will be easier to use.
The patch will likely need refreshing for SVN, but I'm confirming the bug so it doesn't get lost. Jonathan, any chance you could update the patch? Sorry it hadn't been reviewed before, but we're trying to pay closer attention to bugs and patches now.
*** Bug 488657 has been marked as a duplicate of this bug. ***
Bug 523666 just added this column in SVN trunk, so all we need now is the metadata field in the Track Metadata window.
*** Bug 538031 has been marked as a duplicate of this bug. ***
*** Bug 531923 has been marked as a duplicate of this bug. ***
Created attachment 116731 [details] Mock-up for the metadata editor
I am thinking about a new arrangement of the fields in the metadata editor. The Comment field is needed, because it was a tag in ID3v1. Also it seems that the Composer field is important, because has been included in the TrackInfo class. What do you think about this mock-up? This would imply little changes in TrackEditor, just add the new fields.
Created attachment 116733 [details] [review] Patch with the changes in TrackEditor and the Glade file This would be the patch to get the mock-up work. A pretty button to sort the track number would be needed ;)
Created attachment 116872 [details] [review] Patch with the changes in TrackEditor and the Glade file
Created attachment 116891 [details] screenshot of the patch in use This screenshot shows this patch isn't ready yet. I think we can get rid of the sync track count and track num buttons, replace the "/" with "of", and fix the 'automatically set track num/count' button.
Whoops, there is no sync track num button, and we probably do want to keep the 'sync track count' button. Can you make the 'n' in Track number uppercase, too? I think the sync buttons would go much better after the value, instead of before the label. If they're after the value, then you type in a new value, press tab and then enter to sync - a much more likely workflow than wanting to sync all then edit the value.
(In reply to comment #15) > Whoops, there is no sync track num button, and we probably do want to keep the > 'sync track count' button. Can you make the 'n' in Track number uppercase, > too? > > I think the sync buttons would go much better after the value, instead of > before the label. If they're after the value, then you type in a new value, > press tab and then enter to sync - a much more likely workflow than wanting to > sync all then edit the value. Sorry I'm not at home to test this patch, but doesn't it just add the Composer and Comment fields at the bottom? It doesn't seem to affect "Track number".
Benjamin, Aaron has some idea of what he wants to really revamp the Editor dialog, and he plans on finishing it for Banshee 1.4. Unfortunately that means that your patch probably won't be committed, but hopefully Aaron can use it in his revamp work. I wouldn't spend any more time on this particular issue, for now. Sorry :(
Would it not be possible to commit this before revamping? I'd be willing to test it out this evening if it would help.
(In reply to comment #17) > I wouldn't spend any more time on this particular issue, for > now. Sorry :( Thanks for advising Gabriel, anyway I will attach what I have made with your comments, very very similar to the EasyTag dialog. By the way, if I want to try to make some patch for some bug (I have very few experience in C#), should I ask in the list or here before?
(In reply to comment #19) > By the way, if I want to try to make some patch for some bug (I have very few > experience in C#), should I ask in the list or here before? I'd like to say you don't need to you, just work on it and submit it, but considering what happened, here, feel more than free to ask on the bug on on banshee-list.
Created attachment 116908 [details] Mock-up for the metadata editor
Created attachment 116909 [details] [review] Patch with the changes in TrackEditor and the Glade file
(In reply to comment #20) > I'd like to say you don't need to you, just work on it and submit it, but > considering what happened, here, feel more than free to ask on the bug on on > banshee-list. Thanks Gabriel, I just wanted to help. I will keep on trying. See you in the list ;)
Aaron reworked the metadata editor recently and it includes the Composer field, which we also read (and write, if you have write-to-file preference on) and can show as a column and can search/make smart playlists on. So, closing! Thanks so much for your work Benjamin, sorry we weren't faster to respond and didn't end up getting your patch in.
Gabriel, which Vorbis metadata field is used for it? According to the Vorbis recommendations, the ARTIST field should contain the composer, and the PERFORMER fields (yes, could be more than one!) denote the, well, performers.
(In reply to comment #25) > Gabriel, which Vorbis metadata field is used for it? According to the Vorbis > recommendations, the ARTIST field should contain the composer, and the > PERFORMER fields (yes, could be more than one!) denote the, well, performers. ...as noted in http://www.xiph.org/vorbis/doc/v-comment.html.
Wouter, I don't know, that's handled for us by TagLib#. If it's not working properly, you should file bugs in their bug tracker.