[longomatch] Make playlist rendering work again
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Make playlist rendering work again
- Date: Sun, 18 Dec 2011 21:38:54 +0000 (UTC)
commit 5ce448ed46e21cb86694532e6df30c80c6119f60
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Fri Nov 4 23:35:19 2011 +0100
Make playlist rendering work again
LongoMatch.Core/Common/Job.cs | 5 +++--
LongoMatch.Core/Handlers/Handlers.cs | 4 +---
LongoMatch.GUI/Gui/Component/PlayListWidget.cs | 6 ++++--
.../Gui/Component/PlaysListTreeWidget.cs | 9 ++++-----
LongoMatch.GUI/Gui/MainWindow.cs | 12 ++++++------
LongoMatch.GUI/gtk-gui/objects.xml | 3 +--
LongoMatch.Services/Services/Core.cs | 3 ++-
.../Services/RenderingJobsManager.cs | 6 ++++--
8 files changed, 25 insertions(+), 23 deletions(-)
---
diff --git a/LongoMatch.Core/Common/Job.cs b/LongoMatch.Core/Common/Job.cs
index 51e80c5..28db723 100644
--- a/LongoMatch.Core/Common/Job.cs
+++ b/LongoMatch.Core/Common/Job.cs
@@ -18,13 +18,14 @@
using System;
using LongoMatch.Common;
+using LongoMatch.Interfaces;
namespace LongoMatch.Common
{
[Serializable]
public class Job
{
- public Job (PlayList playlist, EncodingSettings encSettings,
+ public Job (IPlayList playlist, EncodingSettings encSettings,
bool enableAudio, bool overlayTitle)
{
Playlist = Cloner.Clone(playlist);
@@ -63,7 +64,7 @@ namespace LongoMatch.Common
}
}
- public PlayList Playlist{
+ public IPlayList Playlist{
get;
set;
}
diff --git a/LongoMatch.Core/Handlers/Handlers.cs b/LongoMatch.Core/Handlers/Handlers.cs
index cfa90d7..6f1b0f4 100644
--- a/LongoMatch.Core/Handlers/Handlers.cs
+++ b/LongoMatch.Core/Handlers/Handlers.cs
@@ -73,8 +73,6 @@ namespace LongoMatch.Handlers
public delegate void NewPlaylistHandler();
/* Save a playlist */
public delegate void SavePlaylistHandler();
- /* Render a playlist */
- public delegate void RenderPlaylistHandler();
/* Drawing events */
/* Draw tool changed */
@@ -97,7 +95,7 @@ namespace LongoMatch.Handlers
public delegate void SnapshotSeriesHandler(Play tNode);
/* Add a new rendering job */
- public delegate void NewJobHandler(Job job);
+ public delegate void RenderPlaylistHandler(IPlayList playlist);
/* A date was selected */
public delegate void DateSelectedHandler(DateTime selectedDate);
diff --git a/LongoMatch.GUI/Gui/Component/PlayListWidget.cs b/LongoMatch.GUI/Gui/Component/PlayListWidget.cs
index 48108cf..1e48f75 100644
--- a/LongoMatch.GUI/Gui/Component/PlayListWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/PlayListWidget.cs
@@ -35,12 +35,13 @@ namespace LongoMatch.Gui.Component
{
public event PlayListNodeSelectedHandler PlayListNodeSelected;
public event ApplyCurrentRateHandler ApplyCurrentRate;
- public event NewJobHandler NewRenderingJob;
public event OpenPlaylistHandler OpenPlaylistEvent;
public event NewPlaylistHandler NewPlaylistEvent;
public event SavePlaylistHandler SavePlaylistEvent;
public event RenderPlaylistHandler RenderPlaylistEvent;
+ IPlayList playlist;
+
public PlayListWidget()
{
this.Build();
@@ -56,6 +57,7 @@ namespace LongoMatch.Gui.Component
}
public void Load(IPlayList playlist) {
+ this.playlist = playlist;
label1.Visible = false;
newvideobutton.Show();
playlisttreeview1.PlayList = playlist;
@@ -117,7 +119,7 @@ namespace LongoMatch.Gui.Component
protected virtual void OnNewvideobuttonClicked(object sender, System.EventArgs e)
{
if (RenderPlaylistEvent != null)
- RenderPlaylistEvent();
+ RenderPlaylistEvent((PlayList)playlist);
}
}
}
diff --git a/LongoMatch.GUI/Gui/Component/PlaysListTreeWidget.cs b/LongoMatch.GUI/Gui/Component/PlaysListTreeWidget.cs
index cb6ef4f..28f1395 100644
--- a/LongoMatch.GUI/Gui/Component/PlaysListTreeWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/PlaysListTreeWidget.cs
@@ -42,7 +42,7 @@ namespace LongoMatch.Gui.Component
public event PlayListNodeAddedHandler PlayListNodeAdded;
public event SnapshotSeriesHandler SnapshotSeriesEvent;
public event TagPlayHandler TagPlay;
- public event NewJobHandler NewRenderingJob;
+ public event RenderPlaylistHandler RenderPlaylistEvent;
private Project project;
@@ -194,10 +194,9 @@ namespace LongoMatch.Gui.Component
playlist.Add(new PlayListPlay((Play)treeview.Model.GetValue(iter, 0),
project.Description.File, 1, true));
}
- /* FIXME
- job = GuiUtils.ConfigureRenderingJob(playlist, this);
- if (job != null && NewRenderingJob != null)
- NewRenderingJob(job); */
+
+ if (RenderPlaylistEvent != null)
+ RenderPlaylistEvent(playlist);
}
}
}
diff --git a/LongoMatch.GUI/Gui/MainWindow.cs b/LongoMatch.GUI/Gui/MainWindow.cs
index 55c8e09..8ecd6f8 100644
--- a/LongoMatch.GUI/Gui/MainWindow.cs
+++ b/LongoMatch.GUI/Gui/MainWindow.cs
@@ -56,7 +56,7 @@ namespace LongoMatch.Gui
public event TimeNodeChangedHandler TimeNodeChanged;
/* Playlist */
- public event NewJobHandler NewJobEvent;
+ public event RenderPlaylistHandler RenderPlaylistEvent;
public event PlayListNodeAddedHandler PlayListNodeAddedEvent;
public event PlayListNodeSelectedHandler PlayListNodeSelectedEvent;
public event OpenPlaylistHandler OpenPlaylistEvent;
@@ -217,8 +217,8 @@ namespace LongoMatch.Gui
visitorPlayersList.SnapshotSeriesEvent += EmitSnapshotSeries;
tagsList.SnapshotSeriesEvent += EmitSnapshotSeries;
- playlist.NewRenderingJob += EmitNewJob;
- playsList.NewRenderingJob += EmitNewJob;
+ playlist.RenderPlaylistEvent += EmitRenderPlaylist;
+ playsList.RenderPlaylistEvent += EmitRenderPlaylist;
renderingstatebar1.ManageJobs += (e, o) => {EmitManageJobs();};
@@ -663,9 +663,9 @@ namespace LongoMatch.Gui
NewTagStopEvent (category);
}
- private void EmitNewJob(Job job) {
- if (NewJobEvent != null)
- NewJobEvent(job);
+ private void EmitRenderPlaylist(IPlayList playlist) {
+ if (RenderPlaylistEvent != null)
+ RenderPlaylistEvent(playlist);
}
private void EmitApplyRate(PlayListPlay plNode) {
diff --git a/LongoMatch.GUI/gtk-gui/objects.xml b/LongoMatch.GUI/gtk-gui/objects.xml
index 39d35ab..221f5d4 100644
--- a/LongoMatch.GUI/gtk-gui/objects.xml
+++ b/LongoMatch.GUI/gtk-gui/objects.xml
@@ -208,7 +208,6 @@
<itemgroup label="PlayListWidget Signals">
<signal name="PlayListNodeSelected" />
<signal name="ApplyCurrentRate" />
- <signal name="NewRenderingJob" />
<signal name="OpenPlaylistEvent" />
<signal name="NewPlaylistEvent" />
<signal name="SavePlaylistEvent" />
@@ -311,7 +310,7 @@
<signal name="PlayListNodeAdded" />
<signal name="SnapshotSeriesEvent" />
<signal name="TagPlay" />
- <signal name="NewRenderingJob" />
+ <signal name="RenderPlaylistEvent" />
</itemgroup>
</signals>
</object>
diff --git a/LongoMatch.Services/Services/Core.cs b/LongoMatch.Services/Services/Core.cs
index 3c1a398..d26f853 100644
--- a/LongoMatch.Services/Services/Core.cs
+++ b/LongoMatch.Services/Services/Core.cs
@@ -77,7 +77,8 @@ namespace LongoMatch.Services
/* Start the rendering jobs manager */
videoRenderer = new RenderingJobsManager(mainWindow.RenderingStateBar);
- mainWindow.NewJobEvent += (job) => {videoRenderer.AddJob(job);};
+ mainWindow.RenderPlaylistEvent += (playlist) => {
+ videoRenderer.AddJob(RenderingJobsManager.ConfigureRenderingJob(playlist, mainWindow));};
projectsManager = new ProjectsManager(mainWindow);
projectsManager.OpenedProjectChanged += OnOpenedProjectChanged;
diff --git a/LongoMatch.Services/Services/RenderingJobsManager.cs b/LongoMatch.Services/Services/RenderingJobsManager.cs
index d483c95..044d227 100644
--- a/LongoMatch.Services/Services/RenderingJobsManager.cs
+++ b/LongoMatch.Services/Services/RenderingJobsManager.cs
@@ -61,6 +61,8 @@ namespace LongoMatch.Services
}
public void AddJob(Job job) {
+ if (job == null)
+ return;
jobs.Add(job);
pendingJobs.Add(job);
UpdateJobsStatus();
@@ -131,7 +133,7 @@ namespace LongoMatch.Services
dialog.Destroy();
}
- public static Job ConfigureRenderingJob (PlayList playlist, Gtk.Widget parent)
+ public static Job ConfigureRenderingJob (IPlayList playlist, Gtk.Widget parent)
{
VideoEditionProperties vep;
Job job = null;
@@ -193,7 +195,7 @@ namespace LongoMatch.Services
}
catch(Exception ex) {
Log.Exception(ex);
- Log.Error("Error redering job: ", currentJob.Playlist.Filename);
+ Log.Error("Error redering job: ", currentJob.Name);
currentJob.State = JobState.Error;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]