summaryrefslogtreecommitdiffstats
path: root/win/CS
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-03-01 18:10:34 +0000
committersr55 <[email protected]>2015-03-01 18:10:34 +0000
commitc8e25b9e67daf7c6902428a442ac19bf4306d5c3 (patch)
treecfaf3560a29050b09fd8934ec6d3ca81abf14984 /win/CS
parent29c62be71227ae33e382199f323890ae3bfffa69 (diff)
WinGui: Dropping more legacy code and moving some more UI only code up to the UI level.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6960 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS')
-rw-r--r--win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj3
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/PresetPictureSettingsMode.cs26
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Interfaces/IHbServiceCallback.cs46
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs33
-rw-r--r--win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs1
-rw-r--r--win/CS/HandBrakeWPF/HandBrakeWPF.csproj2
-rw-r--r--win/CS/HandBrakeWPF/Helpers/AppStyleHelper.cs2
-rw-r--r--win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs1
-rw-r--r--win/CS/HandBrakeWPF/Model/DriveInformation.cs (renamed from win/CS/HandBrake.ApplicationServices/Model/DriveInformation.cs)2
-rw-r--r--win/CS/HandBrakeWPF/Services/NotificationService.cs1
-rw-r--r--win/CS/HandBrakeWPF/Utilities/DriveUtilities.cs53
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs4
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs5
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs2
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs1
15 files changed, 58 insertions, 124 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj
index bb00bc266..6f2826306 100644
--- a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj
+++ b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj
@@ -212,7 +212,6 @@
<Compile Include="Services\Encode\Model\Models\Video\VideoPreset.cs" />
<Compile Include="Services\Encode\Model\Models\Video\VideoProfile.cs" />
<Compile Include="Services\Encode\Model\Models\Video\VideoTune.cs" />
- <Compile Include="Services\Interfaces\IHbServiceCallback.cs" />
<Compile Include="Services\Scan\EventArgs\ScanCompletedEventArgs.cs" />
<Compile Include="Services\Scan\EventArgs\ScanProgressEventArgs.cs" />
<Compile Include="Utilities\Converters.cs" />
@@ -221,7 +220,6 @@
<Compile Include="Utilities\SystemInfo.cs" />
<Compile Include="Utilities\VersionHelper.cs" />
<Compile Include="Utilities\Win32.cs" />
- <Compile Include="Model\DriveInformation.cs" />
<Compile Include="Services\Encode\Model\Models\AllowedPassthru.cs" />
<Compile Include="Services\Encode\Model\Models\AudioTrack.cs" />
<Compile Include="Services\Encode\Model\Models\ChapterMarker.cs" />
@@ -230,7 +228,6 @@
<Compile Include="Services\Encode\Model\EncodeTask.cs" />
<Compile Include="Services\Encode\Model\Models\OutputFormat.cs" />
<Compile Include="Services\Encode\Model\Models\SubtitleTrack.cs" />
- <Compile Include="Model\PresetPictureSettingsMode.cs" />
<Compile Include="Model\QueueItemStatus.cs" />
<Compile Include="Model\QueueTask.cs" />
<Compile Include="Services\Encode\Model\Models\SubtitleType.cs" />
diff --git a/win/CS/HandBrake.ApplicationServices/Model/PresetPictureSettingsMode.cs b/win/CS/HandBrake.ApplicationServices/Model/PresetPictureSettingsMode.cs
deleted file mode 100644
index 030b969e9..000000000
--- a/win/CS/HandBrake.ApplicationServices/Model/PresetPictureSettingsMode.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="PresetPictureSettingsMode.cs" company="HandBrake Project (http://handbrake.fr)">
-// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
-// </copyright>
-// <summary>
-// Picture Settings Mode when adding presets
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrake.ApplicationServices.Model
-{
- using System.ComponentModel.DataAnnotations;
-
- /// <summary>
- /// Picture Settings Mode when adding presets
- /// </summary>
- public enum PresetPictureSettingsMode
- {
- [Display(Name = "None")]
- None = 0,
- [Display(Name = "Custom")]
- Custom = 1,
- [Display(Name = "Source Max Size")]
- SourceMaximum = 2,
- }
-} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IHbServiceCallback.cs b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IHbServiceCallback.cs
deleted file mode 100644
index ce95bd8b5..000000000
--- a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IHbServiceCallback.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="IHbServiceCallback.cs" company="HandBrake Project (http://handbrake.fr)">
-// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
-// </copyright>
-// <summary>
-// HandBrake WCF Service Callbacks
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrake.ApplicationServices.Services.Interfaces
-{
- using System.ServiceModel;
-
- using HandBrake.ApplicationServices.Services.Encode.EventArgs;
-
- /// <summary>
- /// HandBrake WCF Service Callbacks
- /// </summary>
- [ServiceContract]
- public interface IHbServiceCallback
- {
- /// <summary>
- /// The encode progress callback.
- /// </summary>
- /// <param name="eventArgs">
- /// The event Args.
- /// </param>
- [OperationContract(IsOneWay = true)]
- void EncodeProgressCallback(EncodeProgressEventArgs eventArgs);
-
- /// <summary>
- /// The encode completed callback.
- /// </summary>
- /// <param name="eventArgs">
- /// The event Args.
- /// </param>
- [OperationContract(IsOneWay = true)]
- void EncodeCompletedCallback(EncodeCompletedEventArgs eventArgs);
-
- /// <summary>
- /// The encode started callback.
- /// </summary>
- [OperationContract(IsOneWay = true)]
- void EncodeStartedCallback();
- }
-}
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs b/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs
index 7a790f7f9..d74a8f72a 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs
@@ -17,8 +17,6 @@ namespace HandBrake.ApplicationServices.Utilities
using System.Text;
using System.Windows.Forms;
- using HandBrake.ApplicationServices.Model;
-
/// <summary>
/// A Set of Static Utilites
/// </summary>
@@ -144,37 +142,6 @@ namespace HandBrake.ApplicationServices.Utilities
}
/// <summary>
- /// Get a list of available DVD drives which are ready and contain DVD content.
- /// </summary>
- /// <returns>A List of Drives with their details</returns>
- public static List<DriveInformation> GetDrives()
- {
- var drives = new List<DriveInformation>();
- DriveInfo[] theCollectionOfDrives = DriveInfo.GetDrives();
- int id = 0;
- foreach (DriveInfo curDrive in theCollectionOfDrives)
- {
- if (curDrive.DriveType == DriveType.CDRom && curDrive.IsReady)
- {
- if (Directory.Exists(curDrive.RootDirectory + "VIDEO_TS") ||
- Directory.Exists(curDrive.RootDirectory + "BDMV"))
- {
- drives.Add(
- new DriveInformation
- {
- Id = id,
- VolumeLabel = curDrive.VolumeLabel,
- RootDirectory = curDrive.RootDirectory.ToString()
- });
- id++;
- }
- }
- }
-
- return drives;
- }
-
- /// <summary>
/// Return the standard log format line of text for a given log message
/// </summary>
/// <param name="message">
diff --git a/win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs b/win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs
index 32a53277b..adc18ff2d 100644
--- a/win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs
+++ b/win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs
@@ -12,7 +12,6 @@ namespace HandBrakeWPF.Commands
using System;
using System.Windows.Input;
- using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Services.Scan.EventArgs;
using HandBrake.ApplicationServices.Services.Scan.Interfaces;
diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
index e44fd25d7..166d6782a 100644
--- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
+++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
@@ -146,6 +146,7 @@
<Compile Include="Extensions\StringExtensions.cs" />
<Compile Include="Model\Audio\AudioBehaviourModes.cs" />
<Compile Include="Model\Audio\AudioBehaviours.cs" />
+ <Compile Include="Model\DriveInformation.cs" />
<Compile Include="Model\Picture\PresetPictureSettingsMode.cs" />
<Compile Include="Model\Subtitles\SubtitleBehaviourModes.cs" />
<Compile Include="Model\Subtitles\SubtitleBehaviours.cs" />
@@ -164,6 +165,7 @@
<Compile Include="Utilities\AppcastReader.cs" />
<Compile Include="Utilities\DelayedActionProcessor.cs" />
<Compile Include="Utilities\DPIAwareness.cs" />
+ <Compile Include="Utilities\DriveUtilities.cs" />
<Compile Include="Utilities\HandBrakeApp.cs" />
<Compile Include="Services\Presets\Factories\PlistFactory.cs" />
<Compile Include="Utilities\PList.cs" />
diff --git a/win/CS/HandBrakeWPF/Helpers/AppStyleHelper.cs b/win/CS/HandBrakeWPF/Helpers/AppStyleHelper.cs
index 556cf53b4..ece44cfec 100644
--- a/win/CS/HandBrakeWPF/Helpers/AppStyleHelper.cs
+++ b/win/CS/HandBrakeWPF/Helpers/AppStyleHelper.cs
@@ -13,8 +13,6 @@ namespace HandBrakeWPF.Helpers
using Caliburn.Micro;
- using HandBrake.ApplicationServices.Services.Interfaces;
-
using HandBrakeWPF.Services.Interfaces;
/// <summary>
diff --git a/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs b/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs
index ceb8943b8..e73251b07 100644
--- a/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs
+++ b/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs
@@ -19,7 +19,6 @@ namespace HandBrakeWPF.Helpers
using System.Xml.Serialization;
using HandBrake.ApplicationServices.Model;
- using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Utilities;
using HandBrakeWPF.Services.Interfaces;
diff --git a/win/CS/HandBrake.ApplicationServices/Model/DriveInformation.cs b/win/CS/HandBrakeWPF/Model/DriveInformation.cs
index 25ff6930b..f7e966b5c 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/DriveInformation.cs
+++ b/win/CS/HandBrakeWPF/Model/DriveInformation.cs
@@ -7,7 +7,7 @@
// </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrake.ApplicationServices.Model
+namespace HandBrakeWPF.Model
{
/// <summary>
/// Information about a DVD drive
diff --git a/win/CS/HandBrakeWPF/Services/NotificationService.cs b/win/CS/HandBrakeWPF/Services/NotificationService.cs
index 0f387fec3..d85a63d42 100644
--- a/win/CS/HandBrakeWPF/Services/NotificationService.cs
+++ b/win/CS/HandBrakeWPF/Services/NotificationService.cs
@@ -11,7 +11,6 @@ namespace HandBrakeWPF.Services
{
using HandBrake.ApplicationServices.Services.Encode.EventArgs;
using HandBrake.ApplicationServices.Services.Encode.Interfaces;
- using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrakeWPF.Services.Interfaces;
diff --git a/win/CS/HandBrakeWPF/Utilities/DriveUtilities.cs b/win/CS/HandBrakeWPF/Utilities/DriveUtilities.cs
new file mode 100644
index 000000000..d07056ef8
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Utilities/DriveUtilities.cs
@@ -0,0 +1,53 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="DriveUtilities.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// The drive utilities.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Utilities
+{
+ using System.Collections.Generic;
+ using System.IO;
+
+ using HandBrakeWPF.Model;
+
+ /// <summary>
+ /// The drive utilities.
+ /// </summary>
+ public class DriveUtilities
+ {
+ /// <summary>
+ /// Get a list of available DVD drives which are ready and contain DVD content.
+ /// </summary>
+ /// <returns>A List of Drives with their details</returns>
+ public static List<DriveInformation> GetDrives()
+ {
+ var drives = new List<DriveInformation>();
+ DriveInfo[] theCollectionOfDrives = DriveInfo.GetDrives();
+ int id = 0;
+ foreach (DriveInfo curDrive in theCollectionOfDrives)
+ {
+ if (curDrive.DriveType == DriveType.CDRom && curDrive.IsReady)
+ {
+ if (Directory.Exists(curDrive.RootDirectory + "VIDEO_TS") ||
+ Directory.Exists(curDrive.RootDirectory + "BDMV"))
+ {
+ drives.Add(
+ new DriveInformation
+ {
+ Id = id,
+ VolumeLabel = curDrive.VolumeLabel,
+ RootDirectory = curDrive.RootDirectory.ToString()
+ });
+ id++;
+ }
+ }
+ }
+
+ return drives;
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs
index 65464f3f9..189472949 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs
@@ -12,10 +12,7 @@ namespace HandBrakeWPF.ViewModels
using System.Collections.Generic;
using System.Windows;
- using HandBrake.ApplicationServices.Model;
- using HandBrake.ApplicationServices.Services;
using HandBrake.ApplicationServices.Services.Encode.Model;
- using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Services.Scan.Model;
using HandBrake.ApplicationServices.Utilities;
using HandBrake.ApplicationServices.Interop.Model.Encoding;
@@ -23,7 +20,6 @@ namespace HandBrakeWPF.ViewModels
using HandBrakeWPF.Model.Audio;
using HandBrakeWPF.Model.Subtitles;
using HandBrakeWPF.Properties;
- using HandBrakeWPF.Services;
using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.Services.Presets;
using HandBrakeWPF.Services.Presets.Interfaces;
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 08662882c..9c46008f8 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -26,7 +26,6 @@ namespace HandBrakeWPF.ViewModels
using HandBrake.ApplicationServices.Services.Encode.Interfaces;
using HandBrake.ApplicationServices.Services.Encode.Model;
using HandBrake.ApplicationServices.Services.Encode.Model.Models;
- using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Services.Scan.EventArgs;
using HandBrake.ApplicationServices.Services.Scan.Interfaces;
using HandBrake.ApplicationServices.Services.Scan.Model;
@@ -499,7 +498,7 @@ namespace HandBrakeWPF.ViewModels
// Check if we have a Folder, if so, check if it's a DVD / Bluray drive and get the label.
if (ScannedSource.ScanPath.EndsWith("\\"))
{
- foreach (DriveInformation item in GeneralUtilities.GetDrives())
+ foreach (DriveInformation item in DriveUtilities.GetDrives())
{
if (item.RootDirectory.Contains(this.ScannedSource.ScanPath.Replace("\\\\", "\\")))
{
@@ -1000,7 +999,7 @@ namespace HandBrakeWPF.ViewModels
if (this.showSourceSelection)
{
this.Drives.Clear();
- foreach (SourceMenuItem menuItem in from item in GeneralUtilities.GetDrives()
+ foreach (SourceMenuItem menuItem in from item in DriveUtilities.GetDrives()
let driveInformation = item
select new SourceMenuItem
{
diff --git a/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs
index 6d4fcc84a..c85c707bd 100644
--- a/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs
@@ -13,8 +13,6 @@ namespace HandBrakeWPF.ViewModels
using Caliburn.Micro;
- using HandBrake.ApplicationServices.Services.Interfaces;
-
using HandBrakeWPF.Model;
using HandBrakeWPF.Properties;
using HandBrakeWPF.Services.Interfaces;
diff --git a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
index ff1b1a0c9..012a4c15b 100644
--- a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
@@ -24,7 +24,6 @@ namespace HandBrakeWPF.ViewModels
using HandBrake.ApplicationServices.Services.Encode.Interfaces;
using HandBrake.ApplicationServices.Services.Encode.Model;
using HandBrake.ApplicationServices.Services.Encode.Model.Models;
- using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Services.Scan.Interfaces;
using HandBrake.ApplicationServices.Services.Scan.Model;
using HandBrake.ApplicationServices.Interop.Model.Encoding;