summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Oesterholt <hans@oesterholt.net>2013-01-15 11:28:29 +0100
committerHans Oesterholt <hans@oesterholt.net>2013-01-15 11:28:29 +0100
commit0b220f82dec1a34fe1f6c73d2b40ac4f327853fd (patch)
tree81ffcba8ef902183fa9fcbea34766fdd65dc9125
parentc01292eee08e5dbb742c7277b160a873c42c54ad (diff)
Changed from configuration database to own table for cuesheet property storage.
Added composer list, because cuesheet owners usually have lots of classical music. And one wants to be able to filter on composers
-rw-r--r--src/CueSheets/Banshee.CueSheets/CS_AlbumModel.cs22
-rw-r--r--src/CueSheets/Banshee.CueSheets/CS_ArtistModel.cs15
-rw-r--r--src/CueSheets/Banshee.CueSheets/CS_ComposerInfo.cs55
-rw-r--r--src/CueSheets/Banshee.CueSheets/CS_ComposerModel.cs90
-rw-r--r--src/CueSheets/Banshee.CueSheets/CS_GenreModel.cs2
-rw-r--r--src/CueSheets/Banshee.CueSheets/CS_TrackInfoDb.cs104
-rw-r--r--src/CueSheets/Banshee.CueSheets/ComposerListView.cs17
-rw-r--r--src/CueSheets/Banshee.CueSheets/CueSheetsSource.cs104
-rw-r--r--src/CueSheets/CueSheets.csproj4
-rw-r--r--src/CueSheets/Makefile.am4
10 files changed, 388 insertions, 29 deletions
diff --git a/src/CueSheets/Banshee.CueSheets/CS_AlbumModel.cs b/src/CueSheets/Banshee.CueSheets/CS_AlbumModel.cs
index 9d24b89..d65d2f9 100644
--- a/src/CueSheets/Banshee.CueSheets/CS_AlbumModel.cs
+++ b/src/CueSheets/Banshee.CueSheets/CS_AlbumModel.cs
@@ -38,6 +38,7 @@ namespace Banshee.CueSheets
private List<CS_AlbumInfo> _filteredList;
private GenreInfo _genre;
private ArtistInfo _artist;
+ private CS_ComposerInfo _composer;
public CS_AlbumModel (CueSheetsSource s) {
MySource=s;
@@ -48,7 +49,7 @@ namespace Banshee.CueSheets
}
public override void Clear () {
- Console.WriteLine ("clear");
+ // does nothing
}
public override void Reload () {
@@ -59,6 +60,10 @@ namespace Banshee.CueSheets
if (_artist!=null) {
artist=Loosely.prepare(_artist.Name);
}
+ string composer="";
+ if (_composer!=null) {
+ composer=Loosely.prepare (_composer.Name);
+ }
for(i=0,N=s.Count;i<N;i++) {
bool do_add=true;
if (_genre!=null) {
@@ -67,6 +72,9 @@ namespace Banshee.CueSheets
if (_artist!=null) {
if (!Loosely.eqp (artist,s[i].performer ())) { do_add=false; }
}
+ if (_composer!=null) {
+ if (!Loosely.eqp (composer,s[i].composer ())) { do_add=false; }
+ }
if (do_add) {
_filteredList.Add (new CS_AlbumInfo(s[i]));
}
@@ -83,6 +91,7 @@ namespace Banshee.CueSheets
} else if (_genre==null) {
_genre=g;
_artist=null;
+ _composer=null;
Reload ();
} else {
if (_genre.Genre==g.Genre) {
@@ -90,6 +99,7 @@ namespace Banshee.CueSheets
} else {
_genre=g;
_artist=null;
+ _composer=null;
Reload ();
}
}
@@ -107,6 +117,15 @@ namespace Banshee.CueSheets
public ArtistInfo filterArtist() {
return _artist;
}
+
+ public CS_ComposerInfo filterComposer() {
+ return _composer;
+ }
+
+ public void filterComposer(CS_ComposerInfo c) {
+ _composer=c;
+ Reload ();
+ }
public override int Count {
get {
@@ -118,6 +137,7 @@ namespace Banshee.CueSheets
public override AlbumInfo this[int index] {
get {
if (index>=Count) { return new CS_AlbumInfo(null); }
+ if (index<0) { return new CS_AlbumInfo(null); }
return _filteredList[index];
}
}
diff --git a/src/CueSheets/Banshee.CueSheets/CS_ArtistModel.cs b/src/CueSheets/Banshee.CueSheets/CS_ArtistModel.cs
index fa6a764..cfe459b 100644
--- a/src/CueSheets/Banshee.CueSheets/CS_ArtistModel.cs
+++ b/src/CueSheets/Banshee.CueSheets/CS_ArtistModel.cs
@@ -37,6 +37,7 @@ namespace Banshee.CueSheets
private List<CS_ArtistInfo> _artists;
private CS_ArtistInfo _nullArtist;
private GenreInfo _genre;
+ private CS_ComposerInfo _composer;
public CS_ArtistModel (CueSheetsSource s) {
MySource=s;
@@ -46,7 +47,7 @@ namespace Banshee.CueSheets
}
public override void Clear () {
- Console.WriteLine ("clear");
+ // does nothing
}
private bool exists(string artist) {
@@ -60,6 +61,8 @@ namespace Banshee.CueSheets
_artists.Clear ();
List<CueSheet> s=MySource.getSheets ();
_artists.Add(_nullArtist);
+ string composer="";
+ if (_composer!=null) { composer=Loosely.prepare (_composer.Name); }
for(int i=0;i<s.Count;i++) {
string perf=Loosely.prepare (s[i].performer ());
if (!added.Contains (perf)) {
@@ -67,6 +70,9 @@ namespace Banshee.CueSheets
if (_genre!=null) {
if (s[i].genre ()!=_genre.Genre) { do_add=false; }
}
+ if (_composer!=null) {
+ if (!Loosely.eqp(composer,s[i].composer())) { do_add=false; }
+ }
if (do_add) {
CS_ArtistInfo a=new CS_ArtistInfo (s[i]);
_artists.Add (a);
@@ -93,7 +99,12 @@ namespace Banshee.CueSheets
_genre=g;
Reload ();
}
-
+
+ public void filterComposer(CS_ComposerInfo g) {
+ _composer=g;
+ Reload ();
+ }
+
public override ArtistInfo this[int index] {
get {
return _artists[index];
diff --git a/src/CueSheets/Banshee.CueSheets/CS_ComposerInfo.cs b/src/CueSheets/Banshee.CueSheets/CS_ComposerInfo.cs
new file mode 100644
index 0000000..efb948d
--- /dev/null
+++ b/src/CueSheets/Banshee.CueSheets/CS_ComposerInfo.cs
@@ -0,0 +1,55 @@
+using System;
+using Banshee.Collection;
+using System.Collections.Generic;
+using System.Collections;
+using Hyena;
+
+namespace Banshee.CueSheets
+{
+ public class CS_ComposerInfo : CacheableItem
+ {
+ private string name;
+ private string name_sort;
+
+ public CS_ComposerInfo ()
+ {
+ }
+
+ private CueSheet _sheet;
+
+ public class Comparer : IComparer<CS_ComposerInfo> {
+ private CaseInsensitiveComparer cmp=new CaseInsensitiveComparer();
+ public int Compare( CS_ComposerInfo a1,CS_ComposerInfo a2 ) {
+ return cmp.Compare (a1.Name,a2.Name);
+ }
+ }
+
+ public CS_ComposerInfo (CueSheet s) {
+ _sheet=s;
+ if (s!=null) {
+ Name=s.composer ();
+ } else {
+ Name="<All Composers>";
+ }
+ }
+
+ public CueSheet getCueSheet() {
+ return _sheet;
+ }
+
+ public virtual string Name {
+ get { return name; }
+ set { name = value; }
+ }
+
+ public virtual string NameSort {
+ get { return name_sort; }
+ set { name_sort = String.IsNullOrEmpty (value) ? null : value; }
+ }
+
+ public string DisplayName {
+ get { return StringUtil.MaybeFallback (Name, "Unknown Composer"); }
+ }
+ }
+}
+
diff --git a/src/CueSheets/Banshee.CueSheets/CS_ComposerModel.cs b/src/CueSheets/Banshee.CueSheets/CS_ComposerModel.cs
new file mode 100644
index 0000000..a618634
--- /dev/null
+++ b/src/CueSheets/Banshee.CueSheets/CS_ComposerModel.cs
@@ -0,0 +1,90 @@
+using System;
+using Banshee.Collection;
+using System.Collections.Generic;
+
+namespace Banshee.CueSheets
+{
+ public class CS_ComposerModel : BansheeListModel<CS_ComposerInfo>
+ {
+ private CueSheetsSource MySource;
+ private List<CS_ComposerInfo> _composers;
+ private CS_ComposerInfo _nullComposer;
+ private GenreInfo _genre;
+ private ArtistInfo _artist;
+
+ public CS_ComposerModel (CueSheetsSource s) {
+ MySource=s;
+ _nullComposer=new CS_ComposerInfo (null);
+ _composers=new List<CS_ComposerInfo>();
+ Selection=new Hyena.Collections.Selection();
+ }
+
+ public override void Clear () {
+ // Does nothing
+ }
+
+ private bool exists(string artist) {
+ int i,N;
+ for(i=0,N=_composers.Count;i<N && !Loosely.eq (_composers[i].Name,artist);i++);
+ return i<N;
+ }
+
+ public override void Reload () {
+ HashSet<string> added=new HashSet<String>();
+ _composers.Clear ();
+ List<CueSheet> s=MySource.getSheets ();
+ _composers.Add(_nullComposer);
+ string artist="";
+ if (_artist!=null) { artist=Loosely.prepare(_artist.Name); }
+ for(int i=0;i<s.Count;i++) {
+ string comp=Loosely.prepare (s[i].composer ());
+ if (!added.Contains (comp)) {
+ bool do_add=true;
+ if (_genre!=null) {
+ if (s[i].genre ()!=_genre.Genre) { do_add=false; }
+ }
+ if (_artist!=null) {
+ if (!Loosely.eqp (artist,s[i].performer ())) { do_add=false; }
+ }
+ if (do_add) {
+ CS_ComposerInfo a=new CS_ComposerInfo (s[i]);
+ _composers.Add (a);
+ added.Add (comp);
+ }
+ }
+ }
+ _composers.Sort (new CS_ComposerInfo.Comparer());
+ base.RaiseReloaded ();
+ }
+
+ public bool isNullComposer(CS_ComposerInfo a) {
+ CS_ComposerInfo aa=(CS_ComposerInfo) a;
+ return aa.getCueSheet ()==null;
+ }
+
+ public override int Count {
+ get {
+ return _composers.Count;
+ }
+ }
+
+ public void filterGenre(GenreInfo g) {
+ _genre=g;
+ Reload ();
+ }
+
+ public void filterArtist(ArtistInfo g) {
+ _artist=g;
+ Reload ();
+ }
+
+ public override CS_ComposerInfo this[int index] {
+ get {
+ return _composers[index];
+ }
+ }
+
+
+ }
+}
+
diff --git a/src/CueSheets/Banshee.CueSheets/CS_GenreModel.cs b/src/CueSheets/Banshee.CueSheets/CS_GenreModel.cs
index 210b442..bad8784 100644
--- a/src/CueSheets/Banshee.CueSheets/CS_GenreModel.cs
+++ b/src/CueSheets/Banshee.CueSheets/CS_GenreModel.cs
@@ -46,7 +46,7 @@ namespace Banshee.CueSheets
}
public override void Clear () {
- Hyena.Log.Information ("clear");
+ // does nothing
}
private bool exists(string s) {
diff --git a/src/CueSheets/Banshee.CueSheets/CS_TrackInfoDb.cs b/src/CueSheets/Banshee.CueSheets/CS_TrackInfoDb.cs
new file mode 100644
index 0000000..f070664
--- /dev/null
+++ b/src/CueSheets/Banshee.CueSheets/CS_TrackInfoDb.cs
@@ -0,0 +1,104 @@
+using System;
+using Banshee.Database;
+using Hyena.Data.Sqlite;
+
+namespace Banshee.CueSheets
+{
+ public class CS_TrackInfoDb
+ {
+ private BansheeDbConnection _con;
+
+ private readonly HyenaSqliteCommand _sql_check;
+ private readonly HyenaSqliteCommand _sql_get;
+ private readonly HyenaSqliteCommand _sql_insert;
+ private readonly HyenaSqliteCommand _sql_update;
+
+
+ public CS_TrackInfoDb (BansheeDbConnection con) {
+ _con=con;
+ _sql_check=new HyenaSqliteCommand("SELECT COUNT(*) FROM cuesheet_info WHERE key=?");
+ _sql_get=new HyenaSqliteCommand("SELECT type,value FROM cuesheet_info WHERE key=?");
+ _sql_insert=new HyenaSqliteCommand("INSERT INTO cuesheet_info VALUES(?,?,?)");
+ _sql_update=new HyenaSqliteCommand("UPDATE cuesheet_info SET type=?, value=? WHERE key=?");
+ try {
+ if (!_con.TableExists ("cuesheet_info")) {
+ _con.Query ("CREATE TABLE cuesheet_info(key varchar,type varchar,value varchar)");
+ _con.Query ("CREATE INDEX cuesheet_idx1 ON cuesheet_info(key)");
+ }
+
+ } catch (System.Exception ex) {
+ Hyena.Log.Information (ex.ToString ());
+ }
+ }
+
+ private void iSet(string key,string type,string val) {
+ try {
+ int cnt=_con.Query<int> (_sql_check,key);
+ //int cnt=(int) Convert.ChangeType (rdr[0],typeof(int));
+ if (cnt==0) {
+ _con.Execute(_sql_insert,key,type,val);
+ } else {
+ _con.Execute(_sql_update,type,val,key);
+ }
+ } catch(System.Exception ex) {
+ Hyena.Log.Information (ex.ToString ());
+ }
+ }
+
+ private bool iGet(string key,out string type,out string val) {
+ type="";
+ val="";
+ try {
+ int cnt=_con.Query<int>(_sql_check,key);
+ if (cnt==0) {
+ return false;
+ } else {
+ IDataReader rdr=_con.Query(_sql_get,key);
+ rdr.Read ();
+ type=rdr.Get<string>("type");
+ val=rdr.Get<string>("value");
+ return true;
+ }
+ } catch (System.Exception ex) {
+ Hyena.Log.Information (ex.ToString ());
+ return false;
+ }
+ }
+
+ public void Set(string key,int val) {
+ iSet (key,"int",val.ToString ());
+ }
+
+ public void Get(string key,out int val,int _default) {
+ string t,v;
+ if (iGet (key,out t,out v)) {
+ if (t=="int") {
+ val=Convert.ToInt32 (v);
+ } else {
+ val=_default;
+ }
+ } else {
+ val=_default;
+ }
+ }
+
+ public void Set(string key,bool val) {
+ iSet (key,"bool",val.ToString ());
+ }
+
+ public void Get(string key,out bool val,bool _default) {
+ string t,v;
+ if (iGet (key,out t,out v)) {
+ if (t=="bool") {
+ val=Convert.ToBoolean (v);
+ } else {
+ val=_default;
+ }
+ } else {
+ val=_default;
+ }
+ }
+
+ }
+}
+
diff --git a/src/CueSheets/Banshee.CueSheets/ComposerListView.cs b/src/CueSheets/Banshee.CueSheets/ComposerListView.cs
new file mode 100644
index 0000000..e80137d
--- /dev/null
+++ b/src/CueSheets/Banshee.CueSheets/ComposerListView.cs
@@ -0,0 +1,17 @@
+using System;
+using Banshee.Collection.Gui;
+using Hyena.Data.Gui;
+
+namespace Banshee.CueSheets
+{
+
+ public class ComposerListView : TrackFilterListView<CS_ComposerInfo>
+ {
+ public ComposerListView () : base ()
+ {
+ column_controller.Add (new Column ("Composer", new ColumnCellText ("DisplayName", true), 1.0));
+ ColumnController = column_controller;
+ }
+ }
+}
+
diff --git a/src/CueSheets/Banshee.CueSheets/CueSheetsSource.cs b/src/CueSheets/Banshee.CueSheets/CueSheetsSource.cs
index 9cf9595..c5d0ccb 100644
--- a/src/CueSheets/Banshee.CueSheets/CueSheetsSource.cs
+++ b/src/CueSheets/Banshee.CueSheets/CueSheetsSource.cs
@@ -74,9 +74,8 @@ namespace Banshee.CueSheets
private CueSheet _sheet=null;
private CueSheetsPrefs _preferences;
- private DatabaseConfigurationClient _config;
+ private CS_TrackInfoDb _track_info_db;
-
public CueSheetsSource () : base (AddinManager.CurrentLocalizer.GetString ("CueSheets"),
AddinManager.CurrentLocalizer.GetString ("CueSheets"),
sort_order,
@@ -84,7 +83,7 @@ namespace Banshee.CueSheets
{
Hyena.Log.Information ("CueSheetsSouce init");
- _config=ServiceManager.DbConnection.Configuration;
+ _track_info_db=new CS_TrackInfoDb(ServiceManager.DbConnection);
_sheet=new CueSheet();
@@ -203,6 +202,7 @@ namespace Banshee.CueSheets
private CS_AlbumModel _model=null;
private CS_ArtistModel _artistModel=null;
private CS_GenreModel _genreModel=null;
+ private CS_ComposerModel _composerModel=null;
public CS_AlbumModel getAlbumModel() {
if (_model==null) {
@@ -231,6 +231,14 @@ namespace Banshee.CueSheets
}
return _artistModel;
}
+
+ public CS_ComposerModel getComposerModel() {
+ if (_composerModel==null) {
+ Hyena.Log.Information ("ComposerModel init");
+ _composerModel=new CS_ComposerModel(this);
+ }
+ return _composerModel;
+ }
public void setPositions(int hb,int hb1,int vp) {
Banshee.Configuration.ConfigurationClient.Set<int>("cuesheets_hb",hb);
@@ -245,27 +253,22 @@ namespace Banshee.CueSheets
}
public bool getGridLayout(string id) {
- //bool grid=_config.Get<bool>("cuesheets_grid_"+id,true);
bool grid=true;
- if (!_config.TryGet<bool> ("cuesheets_grid",id,out grid)) { grid=true; }
- Hyena.Log.Information ("get cuesheets_grid_"+id+"="+grid);
+ _track_info_db.Get ("grid-"+id,out grid,true);
return grid;
}
public void setGridLayout(string id,bool g) {
- Hyena.Log.Information ("setting cuesheets_grid_"+id+" to "+g);
- _config.Set<bool>("cuesheets_grid",id,g);
- //Banshee.Configuration.ConfigurationClient.Set<bool>("cuesheets_grid_"+id,g);
+ _track_info_db.Set ("grid-"+id,g);
}
public void setColumnWidth(string type,string albumid,int w) {
- _config.Set<int>("cuesheets_col_"+type,albumid,w);
+ _track_info_db.Set ("col-"+type+"-"+albumid,w);
}
public int getColumnWidth(string type,string albumid) {
- int w=100;
- if (!_config.TryGet<int>("cuesheets_col_"+type,albumid,out w)) { w=100; }
- Hyena.Log.Information ("columnwidth("+type+","+albumid+")="+w);
+ int w=150;
+ _track_info_db.Get ("col-"+type+"-"+albumid,out w,150);
return w;
}
@@ -286,12 +289,13 @@ namespace Banshee.CueSheets
private Gtk.ListStore store;
private Gtk.VBox box;
//private string type="directory";
- private Gtk.ScrolledWindow ascroll,tscroll,aascroll,gscroll;
+ private Gtk.ScrolledWindow ascroll,tscroll,aascroll,gscroll,ccscroll;
private int index=-1;
private CueSheetsSource MySource=null;
private MyAlbumListView aview;
private Gtk.TreeView view;
- private ArtistListView aaview;
+ private MyArtistListView aaview;
+ private MyComposerListView ccview;
private GenreListView gview;
private Gtk.HPaned hb;
private Gtk.HPaned hb1;
@@ -400,16 +404,19 @@ namespace Banshee.CueSheets
try {
Hyena.Log.Information("Reload albums");
MySource.getAlbumModel ().Reload ();
+ Hyena.Log.Information(MySource.getAlbumModel ().Count.ToString ());
Hyena.Log.Information("Reload artists");
MySource.getArtistModel ().Reload ();
+ Hyena.Log.Information(MySource.getArtistModel ().Count.ToString ());
+ Hyena.Log.Information("Reload composers");
+ MySource.getComposerModel ().Reload ();
+ Hyena.Log.Information(MySource.getComposerModel ().Count.ToString ());
Hyena.Log.Information("Reload genres");
MySource.getGenreModel ().Reload ();
+ Hyena.Log.Information(MySource.getGenreModel ().Count.ToString ());
Hyena.Log.Information("Reload tracks");
MySource.getTrackModel ().Reload ();
Hyena.Log.Information("Reloaded all");
- Hyena.Log.Information(MySource.getAlbumModel ().Count.ToString ());
- Hyena.Log.Information(MySource.getArtistModel ().Count.ToString ());
- Hyena.Log.Information(MySource.getGenreModel ().Count.ToString ());
} catch(System.Exception e) {
Hyena.Log.Information (e.ToString());
}
@@ -490,7 +497,7 @@ namespace Banshee.CueSheets
uint pos=ServiceManager.PlayerEngine.Position;
double p=((double) pos)/1000.0;
if (_positioning && pos<=_position) {
- Hyena.Log.Information ("seek="+_position+", pos="+pos);
+ //Hyena.Log.Information ("seek="+_position+", pos="+pos);
// do nothing
} else {
_positioning=false;
@@ -509,16 +516,16 @@ namespace Banshee.CueSheets
}
}
- if (mscount==0) {
+ if (mscount==0 && index>=0) {
int [] idx=new int[1];
idx[0]=index;
Gtk.TreePath path=new Gtk.TreePath(idx);
- Hyena.Log.Information ("Setting cursor: "+index+", path=");
+ //Hyena.Log.Information ("Setting cursor: "+index+", path=");
Gtk.TreeViewColumn c=new Gtk.TreeViewColumn();
Gtk.TreePath pp;
view.GetCursor (out pp,out c);
- if (pp==null || pp.Indices[0]!=index) {
+ if (pp==null || (pp.Indices[0]!=index && pp.Indices[0]>=0)) {
view.SetCursor (path,null,false);
}
}
@@ -683,6 +690,14 @@ namespace Banshee.CueSheets
}
}
+ internal class MyComposerListView : ComposerListView {
+ public MyComposerListView() : base() {
+ }
+ protected override bool OnPopupMenu() {
+ return false;
+ }
+ }
+
internal class MyGenreListView : GenreListView {
public MyGenreListView() : base () {
}
@@ -756,11 +771,14 @@ namespace Banshee.CueSheets
Hyena.Log.Information("New albumlist");
aview=new MyAlbumListView(this);
aaview=new MyArtistListView();
+ ccview=new MyComposerListView();
gview=new MyGenreListView();
Hyena.Log.Information("init models");
aview.SetModel (MySource.getAlbumModel ());
aaview.SetModel (MySource.getArtistModel ());
gview.SetModel (MySource.getGenreModel ());
+ ccview.SetModel (MySource.getComposerModel());
+
MySource.getGenreModel();
Hyena.Log.Information("model albumlist");
Hyena.Log.Information("albumlist initialized");
@@ -769,6 +787,7 @@ namespace Banshee.CueSheets
aview.Selection.Changed += HandleAviewSelectionChanged;
gview.RowActivated+=new Hyena.Data.Gui.RowActivatedHandler<GenreInfo>(EvtGenreActivated);
aaview.RowActivated+=new Hyena.Data.Gui.RowActivatedHandler<ArtistInfo>(EvtArtistActivated);
+ ccview.RowActivated+=new Hyena.Data.Gui.RowActivatedHandler<CS_ComposerInfo>(EvtComposerActivated);
bar=new Gtk.Toolbar();
if (basedir==null) {
@@ -788,10 +807,33 @@ namespace Banshee.CueSheets
tscroll.Add (view);
gscroll=new Gtk.ScrolledWindow();
gscroll.Add (gview);
+ ccscroll=new Gtk.ScrolledWindow();
+ ccscroll.Add(ccview);
+
+ bool view_artist=true;
+ Gtk.VBox vac=new Gtk.VBox();
+ Gtk.Button vab=new Gtk.Button("Artists");
+ vab.Clicked+=delegate(object sender,EventArgs args) {
+ if (view_artist) {
+ view_artist=false;
+ vab.Label="Composers";
+ vac.Remove (aascroll);
+ vac.PackEnd (ccscroll);
+ ccscroll.ShowAll ();
+ } else {
+ view_artist=true;
+ vab.Label="Artists";
+ vac.Remove (ccscroll);
+ vac.PackEnd (aascroll);
+ aascroll.ShowAll ();
+ }
+ };
+ vac.PackStart (vab,false,false,0);
+ vac.PackEnd (aascroll);
hb=new Gtk.HPaned();
hb.Add(gscroll);
- hb.Add (aascroll);
+ hb.Add (vac);
hb1=new Gtk.HPaned();
hb1.Add (hb);
hb1.Add (ascroll);
@@ -857,7 +899,7 @@ namespace Banshee.CueSheets
public void EvtCursorChanged(object sender,EventArgs a) {
mscount=0; // Reset cursor change timer
- Hyena.Log.Information("sender:"+sender+", "+a);
+ //Hyena.Log.Information("sender:"+sender+", "+a);
}
public void PlayAlbum(CS_AlbumInfo a) {
@@ -877,17 +919,29 @@ namespace Banshee.CueSheets
if (MySource.getGenreModel ().isNullGenre (g)) { g=null; }
MySource.getAlbumModel ().filterGenre(g);
MySource.getArtistModel ().filterGenre(g);
+ MySource.getComposerModel ().filterGenre (g);
SetGrid ();
}
public void EvtArtistActivated(object sender,RowActivatedArgs<ArtistInfo> args) {
- Hyena.Log.Information("I'm here! "+sender+", "+args);
+ //Hyena.Log.Information("I'm here! "+sender+", "+args);
ArtistInfo a=args.RowValue;
if (MySource.getArtistModel ().isNullArtist (a)) { a=null; }
MySource.getAlbumModel ().filterArtist(a);
+ MySource.getComposerModel ().filterArtist (a);
SetGrid ();
}
+ public void EvtComposerActivated(object sender,RowActivatedArgs<CS_ComposerInfo> args) {
+ //Hyena.Log.Information("I'm here! "+sender+", "+args);
+ CS_ComposerInfo a=(CS_ComposerInfo) args.RowValue;
+ if (MySource.getComposerModel ().isNullComposer (a)) { a=null; }
+ MySource.getAlbumModel ().filterComposer(a);
+ MySource.getArtistModel ().filterComposer (a);
+ SetGrid ();
+ }
+
+
public void EvtTrackRowActivated(object sender,Gtk.RowActivatedArgs args) {
Hyena.Log.Information ("Row activated, seeking");
Gtk.TreeSelection selection = (sender as Gtk.TreeView).Selection;
diff --git a/src/CueSheets/CueSheets.csproj b/src/CueSheets/CueSheets.csproj
index 2012cb0..c4f7d93 100644
--- a/src/CueSheets/CueSheets.csproj
+++ b/src/CueSheets/CueSheets.csproj
@@ -105,6 +105,10 @@
<Compile Include="Banshee.CueSheets\CueSheetEditor.cs" />
<Compile Include="Banshee.CueSheets\CS_Info.cs" />
<Compile Include="Banshee.CueSheets\Tools.cs" />
+ <Compile Include="Banshee.CueSheets\CS_TrackInfoDb.cs" />
+ <Compile Include="Banshee.CueSheets\CS_ComposerInfo.cs" />
+ <Compile Include="Banshee.CueSheets\CS_ComposerModel.cs" />
+ <Compile Include="Banshee.CueSheets\ComposerListView.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
diff --git a/src/CueSheets/Makefile.am b/src/CueSheets/Makefile.am
index 72bc25a..acfe571 100644
--- a/src/CueSheets/Makefile.am
+++ b/src/CueSheets/Makefile.am
@@ -2,12 +2,16 @@ ASSEMBLY = Banshee.CueSheets
LINK = $(BANSHEE_LIBS)
SOURCES = \
+ Banshee.CueSheets/ComposerListView.cs \
Banshee.CueSheets/CS_AlbumInfo.cs \
Banshee.CueSheets/CS_AlbumModel.cs \
Banshee.CueSheets/CS_ArtistInfo.cs \
Banshee.CueSheets/CS_ArtistModel.cs \
+ Banshee.CueSheets/CS_ComposerInfo.cs \
+ Banshee.CueSheets/CS_ComposerModel.cs \
Banshee.CueSheets/CS_GenreModel.cs \
Banshee.CueSheets/CS_Info.cs \
+ Banshee.CueSheets/CS_TrackInfoDb.cs \
Banshee.CueSheets/CueSheet.cs \
Banshee.CueSheets/CueSheetEditor.cs \
Banshee.CueSheets/CueSheetEntry.cs \