banshee r4073 - in trunk/banshee: . src/Extensions/Banshee.FileSystemQueue/Banshee.FileSystemQueue
- From: abock svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r4073 - in trunk/banshee: . src/Extensions/Banshee.FileSystemQueue/Banshee.FileSystemQueue
- Date: Mon, 2 Jun 2008 20:35:05 +0000 (UTC)
Author: abock
Date: Mon Jun 2 20:35:05 2008
New Revision: 4073
URL: http://svn.gnome.org/viewvc/banshee?rev=4073&view=rev
Log:
2008-06-02 Aaron Bockover <abock gnome org>
* src/Extensions/Banshee.FileSystemQueue/Banshee.FileSystemQueue/FileSystemQueueSource.cs:
Switch to the FSQ source when items get added to it, set it as the next
playback source if the --play-enqueued argument has been passed either
locally or remotely
Modified:
trunk/banshee/ChangeLog
trunk/banshee/src/Extensions/Banshee.FileSystemQueue/Banshee.FileSystemQueue/FileSystemQueueSource.cs
Modified: trunk/banshee/src/Extensions/Banshee.FileSystemQueue/Banshee.FileSystemQueue/FileSystemQueueSource.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.FileSystemQueue/Banshee.FileSystemQueue/FileSystemQueueSource.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.FileSystemQueue/Banshee.FileSystemQueue/FileSystemQueueSource.cs Mon Jun 2 20:35:05 2008
@@ -98,11 +98,27 @@
foreach (string path in ApplicationContext.CommandLine.Files) {
Enqueue (path);
}
+
+ if (ApplicationContext.CommandLine.Contains ("play-enqueued")) {
+ PlayEnqueued ();
+ }
}
+ uint source_activate_id = 0;
+
public void Enqueue (string path)
{
- importer.QueueSource (path);
+ lock (this) {
+ importer.QueueSource (path);
+
+ if (source_activate_id == 0) {
+ source_activate_id = GLib.Timeout.Add (500, delegate {
+ ServiceManager.SourceManager.SetActiveSource (this);
+ source_activate_id = 0;
+ return false;
+ });
+ }
+ }
}
public override void Dispose ()
@@ -117,6 +133,9 @@
private void OnCommandLineArgument (string argument, object value, bool isFile)
{
if (!isFile) {
+ if (argument == "play-enqueued") {
+ PlayEnqueued ();
+ }
return;
}
@@ -130,6 +149,12 @@
}
}
+ private void PlayEnqueued ()
+ {
+ ServiceManager.PlaybackController.NextSource = this;
+ ServiceManager.PlayerEngine.Play ();
+ }
+
protected override void OnUpdated ()
{
base.OnUpdated ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]