summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsr55 <[email protected]>2009-07-31 15:50:17 +0000
committersr55 <[email protected]>2009-07-31 15:50:17 +0000
commit6051aa0f78e07a069ea44230a72d2e765a1893ba (patch)
tree9732ceceb0cf76eafa2205e4154a8afb398ff16f /win
parentc128a2446a8822918dcff743647a4645fe8c24a6 (diff)
WinGui:
- Fixed and issue during scan where missing audio track information would cause the log parser to throw an exception. - Added support for "Growl for Windows" http://growlforwindows.com/gfw/ - Thanks to bdunnington git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2739 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win')
-rw-r--r--win/C#/Changelog.html32
-rw-r--r--win/C#/EncodeQueue/EncodeAndQueueHandler.cs3
-rw-r--r--win/C#/Functions/GrowlCommunicator.cs109
-rw-r--r--win/C#/HandBrakeCS.csproj11
-rw-r--r--win/C#/Parsing/AudioTrack.cs6
-rw-r--r--win/C#/frmMain.cs5
-rw-r--r--win/C#/frmOptions.Designer.cs1
-rw-r--r--win/C#/frmOptions.resx3
-rw-r--r--win/C#/libraries/Growl.Connector.dllbin0 -> 61440 bytes
-rw-r--r--win/C#/libraries/Growl.CoreLibrary.dllbin0 -> 24576 bytes
10 files changed, 157 insertions, 13 deletions
diff --git a/win/C#/Changelog.html b/win/C#/Changelog.html
index 9bec1dafe..bf5df3582 100644
--- a/win/C#/Changelog.html
+++ b/win/C#/Changelog.html
@@ -8,7 +8,29 @@
<body>
Windows Platform Specific Changlog.<br />
- <h3>Major Changes</h3>
+ <h2>Changes since Snapshot 1 - SVN2592</h2>
+
+ <h4>Major Changes</h4>
+ - Added support for Sparkle for Windows.<br />
+ - Import MacGUI presets.<br />
+ - External SRT supported added.<br />
+
+ <h4>Minor Improvements / Changes</h4>
+ - Some UI layout changes / improvements<br />
+ - Added new options: preferred language, "Dub Foreign language audio" and "Use Foreign language audio and Subtitles"<br />
+ - Remove M4v from format dropdown and add new option "Use iPod/iTunes friendly (.m4v) file extension for MP4<br />
+
+
+ <h4>Fixed</h4>
+ - Re-written the Picture Settings Panel code so it should now work alot better.<br />
+ - Issue where the GUI would error if the encode was stoped too quickly.<br />
+ - Numerous other fixes including: Quality slider resetting to 0 and other settings lost when a title change occurs.<br />
+ - Fixes some scaling / quality issues with QuickTime preview. Also added a possible fix for QT not working on 64bit systems.<br />
+
+
+
+ <h2>Changes since 0.9.3</h2>
+ <h4>Major Changes</h4>
- Video Preview window using QuickTime or VLC. (5 to 60 second preview clips) <br />
- Re-designed audio tab. Now uses a List and allows for >4 audio channels.<br />
@@ -21,9 +43,7 @@ Windows Platform Specific Changlog.<br />
- Improved control over how logs are stored. Logs are now kept in the Application data folder for each user. <br />
- The Main window and the Queue "Start/Stop" buttons are now linked. Start on the main window starts the Queue. They are no longer separate.<br />
-
-
- <h3>Minor Improvements / Changes</h3>
+ <h4>Minor Improvements / Changes</h4>
- Resizable queue Window<br />
- Scanning a source no longer uses a separate popup window. Scanning simply disables the main window, and displays the status much like the MacGUI<br />
- Queue recovery now uses an XML file.<br />
@@ -44,9 +64,7 @@ Windows Platform Specific Changlog.<br />
- CLI status can now be displayed in-GUI instead of the CLI readout. (Experimental)<br />
- Misc Typo's<br />
-
-
- <h3>Fixed</h3>
+ <h4>Fixed</h4>
- Source and Destination fields unpopulated on queue in certain conditions.<br />
- Several bugs in the way x264 widgets are handled with custom x264 strings.<br />
- Fixed a null pointer exception after scan if all presets had been deleted.<br />
diff --git a/win/C#/EncodeQueue/EncodeAndQueueHandler.cs b/win/C#/EncodeQueue/EncodeAndQueueHandler.cs
index 319163de6..a3f8ca6c0 100644
--- a/win/C#/EncodeQueue/EncodeAndQueueHandler.cs
+++ b/win/C#/EncodeQueue/EncodeAndQueueHandler.cs
@@ -448,6 +448,9 @@ namespace Handbrake.EncodeQueue
case "Lock System":
Win32.LockWorkStation();
break;
+ case "Growl Notification":
+ GrowlCommunicator.Notify();
+ break;
case "Quit HandBrake":
Application.Exit();
break;
diff --git a/win/C#/Functions/GrowlCommunicator.cs b/win/C#/Functions/GrowlCommunicator.cs
new file mode 100644
index 000000000..eb4091a43
--- /dev/null
+++ b/win/C#/Functions/GrowlCommunicator.cs
@@ -0,0 +1,109 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Growl.Connector;
+using Growl.CoreLibrary;
+
+namespace Handbrake.Functions
+{
+ /// <summary>
+ /// Provides all functionality for communicating with Growl for Windows.
+ /// </summary>
+ /// <remarks>
+ /// This class is implemented as a static class because:
+ /// 1. It allows nearly all of the Growl-related code to be in one place
+ /// 2. It prevents the main form, queue handler, and any other part of Handbrake from having to declare
+ /// or track any new instance variables
+ /// </remarks>
+ public static class GrowlCommunicator
+ {
+ /// <summary>
+ /// The <see cref="GrowlConnector"/> that actually talks to Growl
+ /// </summary>
+ private static GrowlConnector growl;
+
+ /// <summary>
+ /// The Handbrake application instance that is registered with Growl
+ /// </summary>
+ private static Application application;
+
+ /// <summary>
+ /// Notification shown upon completion of encoding
+ /// </summary>
+ public static NotificationType EncodingComplete;
+
+
+ /// <summary>
+ /// Checks to see if Growl is currently running on the local machine.
+ /// </summary>
+ /// <returns>
+ /// <c>true</c> if Growl is running;
+ /// <c>false</c> otherwise
+ /// </returns>
+ public static bool IsRunning()
+ {
+ Initialize();
+
+ return growl.IsGrowlRunning();
+ }
+
+ /// <summary>
+ /// Registers Handbrake with the local Growl instance
+ /// </summary>
+ /// <remarks>
+ /// This should usually be called at application start-up
+ /// </remarks>
+ public static void Register()
+ {
+ Initialize();
+
+ growl.Register(application, new NotificationType[] { EncodingComplete });
+ }
+
+ /// <summary>
+ /// Sends a notification to Growl. (Since Handbrake currently only supports one type of notification with
+ /// static text, this is a shortcut method).
+ /// </summary>
+ public static void Notify()
+ {
+ string title = "Encoding Complete";
+ string text = "Put down that cocktail...\nyour Handbrake encode is done.";
+ Notification notification = new Notification(application.Name, EncodingComplete.Name, String.Empty, title, text);
+
+ growl.Notify(notification);
+ }
+
+ /// <summary>
+ /// Sends a notification to Growl. (This is the more generic version that could be used in the future if
+ /// more notification types are implemented)
+ /// </summary>
+ /// <param name="notificationType">The <see cref="NotificationType">type</see> of notification to send</param>
+ /// <param name="title">The notification title</param>
+ /// <param name="text">The notification text</param>
+ /// <param name="imageUrl">The notification image as a url</param>
+ public static void Notify(NotificationType notificationType, string title, string text, string imageUrl)
+ {
+ Notification notification = new Notification(application.Name, notificationType.Name, String.Empty, title, text);
+ notification.Icon = imageUrl;
+
+ growl.Notify(notification);
+ }
+
+ /// <summary>
+ /// Initializes the GrowlCommunicator
+ /// </summary>
+ private static void Initialize()
+ {
+ if (growl == null)
+ {
+ growl = new GrowlConnector();
+ growl.EncryptionAlgorithm = Cryptography.SymmetricAlgorithmType.PlainText;
+
+ application = new Application("Handbrake");
+ application.Icon = global::Handbrake.Properties.Resources.logo64;
+
+ EncodingComplete = new NotificationType("Encoding Complete");
+ }
+ }
+ }
+}
diff --git a/win/C#/HandBrakeCS.csproj b/win/C#/HandBrakeCS.csproj
index e89fa5471..9f1667cb9 100644
--- a/win/C#/HandBrakeCS.csproj
+++ b/win/C#/HandBrakeCS.csproj
@@ -91,6 +91,16 @@
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="Growl.Connector, Version=2.0.0.0, Culture=neutral, PublicKeyToken=980c2339411be384, processorArchitecture=x86">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>libraries\Growl.Connector.dll</HintPath>
+ <Private>True</Private>
+ </Reference>
+ <Reference Include="Growl.CoreLibrary, Version=2.0.0.0, Culture=neutral, PublicKeyToken=13e59d82e007b064, processorArchitecture=x86">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>libraries\Growl.CoreLibrary.dll</HintPath>
+ <Private>True</Private>
+ </Reference>
<Reference Include="PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=x86" />
<Reference Include="PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System" />
@@ -190,6 +200,7 @@
<Compile Include="frmUpdater.designer.cs">
<DependentUpon>frmUpdater.cs</DependentUpon>
</Compile>
+ <Compile Include="Functions\GrowlCommunicator.cs" />
<Compile Include="Functions\PresetLoader.cs" />
<Compile Include="Functions\QueryGenerator.cs" />
<Compile Include="Functions\Main.cs" />
diff --git a/win/C#/Parsing/AudioTrack.cs b/win/C#/Parsing/AudioTrack.cs
index c4e1bbc22..56a35194b 100644
--- a/win/C#/Parsing/AudioTrack.cs
+++ b/win/C#/Parsing/AudioTrack.cs
@@ -99,6 +99,8 @@ namespace Handbrake.Parsing
Match bitrate = Regex.Match(audio_track, @"([0-9]*)bps");
string subformat = m.Groups[4].Value.Trim().Contains("iso639") ? null : m.Groups[4].Value;
+ string samplerateVal = samplerate.Success ? samplerate.Groups[0].Value.Replace("Hz", "").Trim() : "0";
+ string bitrateVal = bitrate.Success ? bitrate.Groups[0].Value.Replace("bps", "").Trim() : "0";
if (track.Success)
{
@@ -108,8 +110,8 @@ namespace Handbrake.Parsing
m_language = track.Groups[2].Value,
m_format = m.Groups[3].Value,
m_subFormat = subformat,
- m_frequency = int.Parse(samplerate.Groups[0].Value.Replace("Hz","").Trim()),
- m_bitrate = int.Parse(bitrate.Groups[0].Value.Replace("bps","").Trim()),
+ m_frequency = int.Parse(samplerateVal),
+ m_bitrate = int.Parse(bitrateVal),
m_iso639_2 = iso639_2.Value.Replace("iso639-2: ", "").Replace(")", "")
};
return thisTrack;
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs
index e40f558f7..94e2cc6d0 100644
--- a/win/C#/frmMain.cs
+++ b/win/C#/frmMain.cs
@@ -119,6 +119,9 @@ namespace Handbrake
if (Properties.Settings.Default.tooltipEnable)
ToolTip.Active = true;
+ // Register with Growl (if not using Growl for the encoding completion action, this wont hurt anything)
+ GrowlCommunicator.Register();
+
//Finished Loading
lblStatus.Text = "Loading Complete!";
Application.DoEvents();
@@ -1440,7 +1443,7 @@ namespace Handbrake
dvdInfoPath);
}
- using (StreamReader sr = new StreamReader(dvdInfoPath))
+ using (StreamReader sr = new StreamReader("scanlog.txt"))
{
thisDVD = DVD.Parse(sr);
sr.Close();
diff --git a/win/C#/frmOptions.Designer.cs b/win/C#/frmOptions.Designer.cs
index 9d54c4ec2..ff14b8a89 100644
--- a/win/C#/frmOptions.Designer.cs
+++ b/win/C#/frmOptions.Designer.cs
@@ -176,6 +176,7 @@ namespace Handbrake
"Hibernate",
"Lock system",
"Log off",
+ "Growl Notification",
"Quit HandBrake"});
this.drp_completeOption.Location = new System.Drawing.Point(106, 119);
this.drp_completeOption.Name = "drp_completeOption";
diff --git a/win/C#/frmOptions.resx b/win/C#/frmOptions.resx
index 427cdd964..139d8245b 100644
--- a/win/C#/frmOptions.resx
+++ b/win/C#/frmOptions.resx
@@ -120,9 +120,6 @@
<metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>132, 18</value>
</metadata>
- <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>132, 18</value>
- </metadata>
<metadata name="pathFinder.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
diff --git a/win/C#/libraries/Growl.Connector.dll b/win/C#/libraries/Growl.Connector.dll
new file mode 100644
index 000000000..29e33d610
--- /dev/null
+++ b/win/C#/libraries/Growl.Connector.dll
Binary files differ
diff --git a/win/C#/libraries/Growl.CoreLibrary.dll b/win/C#/libraries/Growl.CoreLibrary.dll
new file mode 100644
index 000000000..0cfe12d33
--- /dev/null
+++ b/win/C#/libraries/Growl.CoreLibrary.dll
Binary files differ