summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Oesterholt <hans@oesterholt.net>2013-01-15 02:05:34 +0100
committerHans Oesterholt <hans@oesterholt.net>2013-01-15 02:05:34 +0100
commitc01292eee08e5dbb742c7277b160a873c42c54ad (patch)
tree6ab1c08ba46e6c62f3383a2532ff86b86920e101
parent3a4fbe0682ad877d41b6d6c63bad5bca323ee19d (diff)
Small bug fixes
-rw-r--r--src/CueSheets/Banshee.CueSheets/CueSheet.cs10
-rw-r--r--src/CueSheets/Banshee.CueSheets/CueSheetsSource.cs54
2 files changed, 41 insertions, 23 deletions
diff --git a/src/CueSheets/Banshee.CueSheets/CueSheet.cs b/src/CueSheets/Banshee.CueSheets/CueSheet.cs
index d822c8f..3c7b2b2 100644
--- a/src/CueSheets/Banshee.CueSheets/CueSheet.cs
+++ b/src/CueSheets/Banshee.CueSheets/CueSheet.cs
@@ -141,7 +141,7 @@ namespace Banshee.CueSheets
if (File.Exists (_img_full_path)) {
string aaid=CoverArtSpec.CreateArtistAlbumId (_performer,_title);
string path=CoverArtSpec.GetPathForNewFile(aaid,_img_full_path);
- File.Delete (path);
+ if (File.Exists (path)) { File.Delete (path); }
File.Copy (_img_full_path,path);
int i,N;
for(i=0,N=nEntries ();i<N;i++) {
@@ -160,6 +160,14 @@ namespace Banshee.CueSheets
File.Copy (_img_full_path,path);
}
}
+ } else {
+ if (File.Exists (_img_full_path)) {
+ string path=CoverArtSpec.GetPathForNewFile (aaid,_img_full_path);
+ if (File.Exists (path)) { File.Delete (path); }
+ if (!File.Exists (path)) {
+ File.Copy (_img_full_path,path);
+ }
+ }
}
return aaid;
}
diff --git a/src/CueSheets/Banshee.CueSheets/CueSheetsSource.cs b/src/CueSheets/Banshee.CueSheets/CueSheetsSource.cs
index 7cc4bf9..9cf9595 100644
--- a/src/CueSheets/Banshee.CueSheets/CueSheetsSource.cs
+++ b/src/CueSheets/Banshee.CueSheets/CueSheetsSource.cs
@@ -285,7 +285,7 @@ namespace Banshee.CueSheets
{
private Gtk.ListStore store;
private Gtk.VBox box;
- private string type="directory";
+ //private string type="directory";
private Gtk.ScrolledWindow ascroll,tscroll,aascroll,gscroll;
private int index=-1;
private CueSheetsSource MySource=null;
@@ -302,6 +302,7 @@ namespace Banshee.CueSheets
private uint _position=0;
private bool _set_position=false;
+ private bool _positioning=false;
private String basedir=null;
private CueSheet _selected=null;
@@ -481,18 +482,25 @@ namespace Banshee.CueSheets
// Position if necessary
if (_set_position) {
_set_position=false;
+ _positioning=true;
ServiceManager.PlayerEngine.Position=_position;
}
-
- // Track number
+
+ // Do nothing while seeking
uint pos=ServiceManager.PlayerEngine.Position;
double p=((double) pos)/1000.0;
- int i=sheet.searchIndex(p);
- if (i!=index && i>=0) {
- // Handle repeat track
- if (ServiceManager.PlaybackController.RepeatMode==PlaybackRepeatMode.RepeatSingle) {
- seekSong (index);
- } else {
+ if (_positioning && pos<=_position) {
+ Hyena.Log.Information ("seek="+_position+", pos="+pos);
+ // do nothing
+ } else {
+ _positioning=false;
+ // Track number
+ int i=sheet.searchIndex(p);
+ if (i!=index && i>=0) {
+ // Handle repeat track
+ if (ServiceManager.PlaybackController.RepeatMode==PlaybackRepeatMode.RepeatSingle) {
+ seekSong (index);
+ }
// Every 2 seconds
if (mscount==0) {
index=i;
@@ -500,21 +508,22 @@ namespace Banshee.CueSheets
ServiceManager.PlayerEngine.SetCurrentTrack (e);
}
}
- }
-
- if (type=="cuesheet" && mscount==0) {
- int [] idx=new int[1];
- idx[0]=index;
- Gtk.TreePath path=new Gtk.TreePath(idx);
- Gtk.TreeViewColumn c=new Gtk.TreeViewColumn();
- Gtk.TreePath pp;
- view.GetCursor (out pp,out c);
- if (pp==null || pp.Indices[0]!=index) {
- view.SetCursor (path,null,false);
+ if (mscount==0) {
+ int [] idx=new int[1];
+ idx[0]=index;
+
+ Gtk.TreePath path=new Gtk.TreePath(idx);
+ 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) {
+ view.SetCursor (path,null,false);
+ }
}
}
-
+
}
}
return true;
@@ -554,7 +563,7 @@ namespace Banshee.CueSheets
public void loadCueSheet(CueSheet s) { //,Gtk.ListStore store) {
setColumnSizes (s);
CueSheet sheet=MySource.getSheet ();
- type="cuesheet";
+ //type="cuesheet";
sheet.Clear ();
sheet.load (s);
store.Clear ();
@@ -880,6 +889,7 @@ namespace Banshee.CueSheets
}
public void EvtTrackRowActivated(object sender,Gtk.RowActivatedArgs args) {
+ Hyena.Log.Information ("Row activated, seeking");
Gtk.TreeSelection selection = (sender as Gtk.TreeView).Selection;
Gtk.TreeModel model;
Gtk.TreeIter iter;