1.0-dev8 (Video panel and videos list added)
@@ -1,8 +0,0 @@
|
||||
namespace VDownload.Core.Enums
|
||||
{
|
||||
public enum DefaultLocationType
|
||||
{
|
||||
Last,
|
||||
Selected
|
||||
}
|
||||
}
|
||||
9
VDownload.Core/Enums/VideoStatus.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace VDownload.Core.Enums
|
||||
{
|
||||
public enum VideoStatus
|
||||
{
|
||||
Idle,
|
||||
Waiting,
|
||||
InProgress
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,11 @@ namespace VDownload.Core.Services
|
||||
{ "default_filename", "[<date_pub:yyyy.MM.dd>] <title>" },
|
||||
{ "default_video_extension", (int)VideoFileExtension.MP4 },
|
||||
{ "default_audio_extension", (int)AudioFileExtension.MP3 },
|
||||
{ "default_location_type", (int)DefaultLocationType.Last },
|
||||
{ "custom_media_location", false },
|
||||
{ "custom_temp_location", false },
|
||||
{ "max_active_video_task", 5 },
|
||||
{ "replace_output_file_if_exists", false },
|
||||
{ "remove_task_when_successfully_ended", false }
|
||||
};
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -48,8 +48,8 @@ namespace VDownload.Core.Services
|
||||
// Init transcoder
|
||||
MediaTranscoder mediaTranscoder = new MediaTranscoder
|
||||
{
|
||||
HardwareAccelerationEnabled = (bool)Config.GetValue("media_processor_use_hardware_acceleration"),
|
||||
VideoProcessingAlgorithm = (bool)Config.GetValue("media_processor_use_mrfcrf444_algorithm") ? MediaVideoProcessingAlgorithm.MrfCrf444 : MediaVideoProcessingAlgorithm.Default,
|
||||
HardwareAccelerationEnabled = (bool)Config.GetValue("media_transcoding_use_hardware_acceleration"),
|
||||
VideoProcessingAlgorithm = (bool)Config.GetValue("media_transcoding_use_mrfcrf444_algorithm") ? MediaVideoProcessingAlgorithm.MrfCrf444 : MediaVideoProcessingAlgorithm.Default,
|
||||
TrimStartTime = TrimStart,
|
||||
TrimStopTime = TrimEnd,
|
||||
};
|
||||
|
||||
@@ -153,20 +153,21 @@ namespace VDownload.Core.Services.Sources.Twitch
|
||||
// DOWNLOAD AND TRANSCODE VOD
|
||||
public async Task<StorageFile> DownloadAndTranscodeAsync(StorageFolder downloadingFolder, Stream audioVideoStream, MediaFileExtension extension, MediaType mediaType, TimeSpan trimStart, TimeSpan trimEnd, CancellationToken cancellationToken = default)
|
||||
{
|
||||
// Set cancellation token
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
// Invoke DownloadingStarted event
|
||||
DownloadingStarted?.Invoke(this, EventArgs.Empty);
|
||||
if (!cancellationToken.IsCancellationRequested) DownloadingStarted?.Invoke(this, EventArgs.Empty);
|
||||
|
||||
// Get video chunks
|
||||
List<(Uri ChunkUrl, TimeSpan ChunkDuration)> chunksList = await ExtractChunksFromM3U8Async(audioVideoStream.Url);
|
||||
List<(Uri ChunkUrl, TimeSpan ChunkDuration)> chunksList = null;
|
||||
if (!cancellationToken.IsCancellationRequested) chunksList = await ExtractChunksFromM3U8Async(audioVideoStream.Url);
|
||||
|
||||
// Passive trim
|
||||
if ((bool)Config.GetValue("twitch_vod_passive_trim")) (trimStart, trimEnd) = PassiveVideoTrim(chunksList, trimStart, trimEnd, Duration);
|
||||
|
||||
// Download
|
||||
StorageFile rawFile = await downloadingFolder.CreateFileAsync("raw.ts");
|
||||
StorageFile rawFile = null;
|
||||
if (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
rawFile = await downloadingFolder.CreateFileAsync("raw.ts");
|
||||
float chunksDownloaded = 0;
|
||||
|
||||
Task<byte[]> downloadTask;
|
||||
@@ -174,26 +175,35 @@ namespace VDownload.Core.Services.Sources.Twitch
|
||||
|
||||
downloadTask = DownloadChunkAsync(chunksList[0].ChunkUrl);
|
||||
await downloadTask;
|
||||
for (int i = 1; i < chunksList.Count; i++)
|
||||
for (int i = 1; i < chunksList.Count && !cancellationToken.IsCancellationRequested; i++)
|
||||
{
|
||||
writeTask = WriteChunkToFileAsync(rawFile, downloadTask.Result);
|
||||
downloadTask = DownloadChunkAsync(chunksList[i].ChunkUrl);
|
||||
await Task.WhenAll(writeTask, downloadTask);
|
||||
DownloadingProgressChanged(this, new ProgressChangedEventArgs((int)Math.Round(++chunksDownloaded * 100 / chunksList.Count), null));
|
||||
}
|
||||
if (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
await WriteChunkToFileAsync(rawFile, downloadTask.Result);
|
||||
DownloadingProgressChanged(this, new ProgressChangedEventArgs((int)Math.Round(++chunksDownloaded * 100 / chunksList.Count), null));
|
||||
|
||||
DownloadingCompleted?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Processing
|
||||
StorageFile outputFile = await downloadingFolder.CreateFileAsync($"transcoded.{extension.ToString().ToLower()}");
|
||||
StorageFile outputFile = null;
|
||||
if (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
outputFile = await downloadingFolder.CreateFileAsync($"transcoded.{extension.ToString().ToLower()}");
|
||||
|
||||
MediaProcessor mediaProcessor = new MediaProcessor(outputFile, trimStart, trimEnd);
|
||||
mediaProcessor.ProcessingStarted += ProcessingStarted;
|
||||
mediaProcessor.ProcessingProgressChanged += ProcessingProgressChanged;
|
||||
mediaProcessor.ProcessingCompleted += ProcessingCompleted;
|
||||
await mediaProcessor.Run(rawFile, extension, mediaType, cancellationToken);
|
||||
}
|
||||
|
||||
// Return output file
|
||||
return outputFile;
|
||||
@@ -298,7 +308,7 @@ namespace VDownload.Core.Services.Sources.Twitch
|
||||
});
|
||||
}
|
||||
|
||||
// PARSE DURATION TO SECONDS
|
||||
// PARSE DURATION
|
||||
private static TimeSpan ParseDuration(string duration)
|
||||
{
|
||||
char[] separators = { 'h', 'm', 's' };
|
||||
@@ -319,15 +329,10 @@ namespace VDownload.Core.Services.Sources.Twitch
|
||||
#region EVENT HANDLERS
|
||||
|
||||
public event EventHandler DownloadingStarted;
|
||||
|
||||
public event EventHandler<ProgressChangedEventArgs> DownloadingProgressChanged;
|
||||
|
||||
public event EventHandler DownloadingCompleted;
|
||||
|
||||
public event EventHandler ProcessingStarted;
|
||||
|
||||
public event EventHandler<ProgressChangedEventArgs> ProcessingProgressChanged;
|
||||
|
||||
public event EventHandler ProcessingCompleted;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -121,13 +121,13 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Enums\AudioFileExtension.cs" />
|
||||
<Compile Include="Enums\DefaultLocationType.cs" />
|
||||
<Compile Include="Enums\MediaFileExtension.cs" />
|
||||
<Compile Include="Enums\MediaType.cs" />
|
||||
<Compile Include="Enums\PlaylistSource.cs" />
|
||||
<Compile Include="Enums\StreamType.cs" />
|
||||
<Compile Include="Enums\VideoFileExtension.cs" />
|
||||
<Compile Include="Enums\VideoSource.cs" />
|
||||
<Compile Include="Enums\VideoStatus.cs" />
|
||||
<Compile Include="EventArgsObjects\VideoAddEventArgs.cs" />
|
||||
<Compile Include="EventArgsObjects\VideoSearchEventArgs.cs" />
|
||||
<Compile Include="EventArgsObjects\PlaylistSearchEventArgs.cs" />
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<svg fill="#FFFFFF" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600"><g transform="matrix(1.20025,0,0,1.20025,-160.6,-160.7)">
|
||||
<svg fill="#000000" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600"><g transform="matrix(1.20025,0,0,1.20025,-160.6,-160.7)">
|
||||
<path d="M416.667,133.333C334.417,133.333 266.667,201.083 266.667,283.333L266.667,1316.67C266.667,1398.92 334.417,1466.67 416.667,1466.67L1183.33,1466.67C1265.58,1466.67 1333.33,1398.92 1333.33,1316.67L1333.33,616.667C1333.33,603.412 1328.06,590.687 1318.68,581.315L885.352,147.982C875.98,138.609 863.255,133.336 850,133.333L416.667,133.333ZM416.667,233.333L800,233.333L800,516.667C800,598.917 867.75,666.667 950,666.667L1233.33,666.667L1233.33,1316.67C1233.33,1344.88 1211.55,1366.67 1183.33,1366.67L416.667,1366.67C388.45,1366.67 366.667,1344.88 366.667,1316.67L366.667,283.333C366.667,255.117 388.45,233.333 416.667,233.333ZM900,304.036L1162.63,566.667L950,566.667C921.783,566.667 900,544.883 900,516.667L900,304.036Z" style="fill-rule:nonzero;"/>
|
||||
</g></svg>
|
||||
|
Before Width: | Height: | Size: 911 B After Width: | Height: | Size: 911 B |
@@ -1,3 +1,3 @@
|
||||
<svg fill="#FFFFFF" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600"><g transform="matrix(1.19956,0,0,1.19956,-159.645,-159.608)">
|
||||
<svg fill="#000000" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600"><g transform="matrix(1.19956,0,0,1.19956,-159.645,-159.608)">
|
||||
<path d="M800,133.333C487.642,133.333 233.333,387.642 233.333,700C233.333,840.226 284.777,968.828 369.271,1067.71L369.531,1067.97L369.727,1068.23C369.727,1068.23 610.791,1343.3 696.615,1425.19C754.086,1479.99 845.849,1479.99 903.32,1425.19C1001.15,1331.89 1230.34,1068.1 1230.34,1068.1L1230.47,1067.9L1230.66,1067.71C1315.23,968.827 1366.67,840.226 1366.67,700C1366.67,387.642 1112.36,133.333 800,133.333ZM800,233.333C1058.31,233.333 1266.67,441.692 1266.67,700C1266.67,815.84 1224.45,921.086 1154.62,1002.73C1154.17,1003.25 919.668,1271.45 834.31,1352.87C814.514,1371.74 785.421,1371.74 765.625,1352.87C694.286,1284.79 446.037,1003.56 445.313,1002.73L445.247,1002.67C375.511,921.028 333.333,815.808 333.333,700C333.333,441.692 541.692,233.333 800,233.333ZM800,500C737.5,500 684.294,525.238 650.13,563.672C615.967,602.106 600,651.389 600,700C600,748.611 615.967,797.894 650.13,836.328C684.294,874.762 737.5,900 800,900C862.5,900 915.706,874.762 949.87,836.328C984.033,797.894 1000,748.611 1000,700C1000,651.389 984.033,602.106 949.87,563.672C915.706,525.238 862.5,500 800,500ZM800,600C837.5,600 859.294,612.262 875.13,630.078C890.967,647.894 900,673.611 900,700C900,726.389 890.967,752.106 875.13,769.922C859.294,787.738 837.5,800 800,800C762.5,800 740.706,787.738 724.87,769.922C709.033,752.106 700,726.389 700,700C700,673.611 709.033,647.894 724.87,630.078C740.706,612.262 762.5,600 800,600Z" style="fill-rule:nonzero;"/>
|
||||
</g></svg>
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
@@ -1,3 +1,3 @@
|
||||
<svg fill="#FFFFFF" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600"><g transform="matrix(1.14286,0,0,1.14286,-114.286,-114.286)">
|
||||
<svg fill="#000000" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600"><g transform="matrix(1.14286,0,0,1.14286,-114.286,-114.286)">
|
||||
<path d="M283.333,233.333C182.674,233.333 100,316.008 100,416.667L100,1183.33C100,1283.99 182.674,1366.67 283.333,1366.67L1316.67,1366.67C1417.33,1366.67 1500,1283.99 1500,1183.33L1500,416.667C1500,316.008 1417.33,233.333 1316.67,233.333L283.333,233.333ZM283.333,333.333L716.667,333.333C763.274,333.333 800,370.059 800,416.667L800,716.667C800,763.274 763.274,800 716.667,800L283.333,800C236.726,800 200,763.274 200,716.667L200,416.667C200,410.841 200.597,405.139 201.693,399.674C209.359,361.422 242.552,333.333 283.333,333.333ZM879.557,333.333L1016.67,333.333C1063.27,333.333 1100,370.059 1100,416.667L1100,950C1100,996.608 1063.27,1033.33 1016.67,1033.33L283.333,1033.33C236.726,1033.33 200,996.608 200,950L200,879.557C225.076,892.51 253.36,900 283.333,900L716.667,900C817.326,900 900,817.326 900,716.667L900,416.667C900,386.693 892.51,358.409 879.557,333.333ZM1179.56,333.333L1316.67,333.333C1363.27,333.333 1400,370.059 1400,416.667L1400,1183.33C1400,1229.94 1363.27,1266.67 1316.67,1266.67L283.333,1266.67C236.726,1266.67 200,1229.94 200,1183.33L200,1112.89C225.076,1125.84 253.36,1133.33 283.333,1133.33L1016.67,1133.33C1117.33,1133.33 1200,1050.66 1200,950L1200,416.667C1200,386.693 1192.51,358.409 1179.56,333.333Z" style="fill-rule:nonzero;"/>
|
||||
</g></svg>
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
3
VDownload/Assets/Icons/StateCancelledDark.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg fill="#FFFFFF" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600"><g transform="matrix(1.201,0,0,1.201,-160.8,-160.8)">
|
||||
<path d="M800,133.333C432.402,133.333 133.333,432.402 133.333,800C133.333,1167.6 432.402,1466.67 800,1466.67C1167.6,1466.67 1466.67,1167.6 1466.67,800C1466.67,432.402 1167.6,133.333 800,133.333ZM800,233.333C1113.55,233.333 1366.67,486.446 1366.67,800C1366.67,1113.55 1113.55,1366.67 800,1366.67C486.446,1366.67 233.333,1113.55 233.333,800C233.333,486.446 486.446,233.333 800,233.333ZM1016.21,532.617C1003.01,532.929 990.458,538.456 981.315,547.982L800,729.297L618.685,547.982C609.273,538.289 596.323,532.813 582.812,532.813C555.385,532.819 532.82,555.39 532.82,582.817C532.82,596.325 538.293,609.273 547.982,618.685L729.297,800L547.982,981.315C538.165,990.741 532.609,1003.78 532.609,1017.39C532.609,1044.82 555.183,1067.39 582.614,1067.39C596.224,1067.39 609.259,1061.84 618.685,1052.02L800,870.703L981.315,1052.02C990.741,1061.84 1003.78,1067.39 1017.39,1067.39C1044.82,1067.39 1067.39,1044.82 1067.39,1017.39C1067.39,1003.78 1061.84,990.741 1052.02,981.315L870.703,800L1052.02,618.685C1061.84,609.259 1067.4,596.22 1067.4,582.608C1067.4,555.176 1044.82,532.603 1017.39,532.603C1017,532.603 1016.61,532.608 1016.21,532.617Z" style="fill-rule:nonzero;"/>
|
||||
</g></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
3
VDownload/Assets/Icons/StateCancelledLight.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg fill="#000000" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600"><g transform="matrix(1.201,0,0,1.201,-160.8,-160.8)">
|
||||
<path d="M800,133.333C432.402,133.333 133.333,432.402 133.333,800C133.333,1167.6 432.402,1466.67 800,1466.67C1167.6,1466.67 1466.67,1167.6 1466.67,800C1466.67,432.402 1167.6,133.333 800,133.333ZM800,233.333C1113.55,233.333 1366.67,486.446 1366.67,800C1366.67,1113.55 1113.55,1366.67 800,1366.67C486.446,1366.67 233.333,1113.55 233.333,800C233.333,486.446 486.446,233.333 800,233.333ZM1016.21,532.617C1003.01,532.929 990.458,538.456 981.315,547.982L800,729.297L618.685,547.982C609.273,538.289 596.323,532.813 582.812,532.813C555.385,532.819 532.82,555.39 532.82,582.817C532.82,596.325 538.293,609.273 547.982,618.685L729.297,800L547.982,981.315C538.165,990.741 532.609,1003.78 532.609,1017.39C532.609,1044.82 555.183,1067.39 582.614,1067.39C596.224,1067.39 609.259,1061.84 618.685,1052.02L800,870.703L981.315,1052.02C990.741,1061.84 1003.78,1067.39 1017.39,1067.39C1044.82,1067.39 1067.39,1044.82 1067.39,1017.39C1067.39,1003.78 1061.84,990.741 1052.02,981.315L870.703,800L1052.02,618.685C1061.84,609.259 1067.4,596.22 1067.4,582.608C1067.4,555.176 1044.82,532.603 1017.39,532.603C1017,532.603 1016.61,532.608 1016.21,532.617Z" style="fill-rule:nonzero;"/>
|
||||
</g></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
3
VDownload/Assets/Icons/StateDoneDark.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg fill="#FFFFFF" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600"><g transform="matrix(1.201,0,0,1.201,-160.8,-160.8)">
|
||||
<path d="M800,133.333C432.402,133.333 133.333,432.402 133.333,800C133.333,1167.6 432.402,1466.67 800,1466.67C1167.6,1466.67 1466.67,1167.6 1466.67,800C1466.67,432.402 1167.6,133.333 800,133.333ZM800,233.333C1113.55,233.333 1366.67,486.446 1366.67,800C1366.67,1113.55 1113.55,1366.67 800,1366.67C486.446,1366.67 233.333,1113.55 233.333,800C233.333,486.446 486.446,233.333 800,233.333ZM1049.02,599.544C1036.04,599.923 1023.71,605.343 1014.65,614.648L716.667,912.63L585.352,781.315C575.926,771.498 562.89,765.943 549.281,765.943C521.849,765.943 499.276,788.516 499.276,815.948C499.276,829.557 504.832,842.593 514.648,852.018L681.315,1018.69C700.711,1038.07 732.622,1038.07 752.018,1018.69L1085.35,685.352C1095.01,675.943 1100.47,663.014 1100.47,649.529C1100.47,622.097 1077.89,599.524 1050.46,599.524C1049.98,599.524 1049.5,599.53 1049.02,599.544Z" style="fill-rule:nonzero;"/>
|
||||
</g></svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
3
VDownload/Assets/Icons/StateDoneLight.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg fill="#000000" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600"><g transform="matrix(1.201,0,0,1.201,-160.8,-160.8)">
|
||||
<path d="M800,133.333C432.402,133.333 133.333,432.402 133.333,800C133.333,1167.6 432.402,1466.67 800,1466.67C1167.6,1466.67 1466.67,1167.6 1466.67,800C1466.67,432.402 1167.6,133.333 800,133.333ZM800,233.333C1113.55,233.333 1366.67,486.446 1366.67,800C1366.67,1113.55 1113.55,1366.67 800,1366.67C486.446,1366.67 233.333,1113.55 233.333,800C233.333,486.446 486.446,233.333 800,233.333ZM1049.02,599.544C1036.04,599.923 1023.71,605.343 1014.65,614.648L716.667,912.63L585.352,781.315C575.926,771.498 562.89,765.943 549.281,765.943C521.849,765.943 499.276,788.516 499.276,815.948C499.276,829.557 504.832,842.593 514.648,852.018L681.315,1018.69C700.711,1038.07 732.622,1038.07 752.018,1018.69L1085.35,685.352C1095.01,675.943 1100.47,663.014 1100.47,649.529C1100.47,622.097 1077.89,599.524 1050.46,599.524C1049.98,599.524 1049.5,599.53 1049.02,599.544Z" style="fill-rule:nonzero;"/>
|
||||
</g></svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
3
VDownload/Assets/Icons/StateDownloadingDark.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg fill="#FFFFFF" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600"><g transform="matrix(1.201,0,0,1.201,-160.8,-160.8)">
|
||||
<path d="M800,133.333C432.402,133.333 133.333,432.402 133.333,800C133.333,1167.6 432.402,1466.67 800,1466.67C1167.6,1466.67 1466.67,1167.6 1466.67,800C1466.67,432.402 1167.6,133.333 800,133.333ZM800,233.333C1113.55,233.333 1366.67,486.446 1366.67,800C1366.67,1113.55 1113.55,1366.67 800,1366.67C486.446,1366.67 233.333,1113.55 233.333,800C233.333,486.446 486.446,233.333 800,233.333ZM799.219,499.284C771.814,499.712 749.607,522.595 750,550L750,929.297L635.352,814.648C625.926,804.832 612.89,799.276 599.281,799.276C571.849,799.276 549.276,821.849 549.276,849.281C549.276,862.89 554.832,875.926 564.648,885.352L764.648,1085.35C784.044,1104.74 815.956,1104.74 835.352,1085.35L1035.35,885.352C1045.17,875.926 1050.72,862.89 1050.72,849.281C1050.72,821.849 1028.15,799.276 1000.72,799.276C987.11,799.276 974.074,804.832 964.648,814.648L850,929.297L850,550C850.003,549.761 850.005,549.522 850.005,549.283C850.005,521.851 827.432,499.278 800,499.278C799.74,499.278 799.479,499.28 799.219,499.284Z" style="fill-rule:nonzero;"/>
|
||||
</g></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
3
VDownload/Assets/Icons/StateDownloadingLight.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg fill="#000000" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600"><g transform="matrix(1.201,0,0,1.201,-160.8,-160.8)">
|
||||
<path d="M800,133.333C432.402,133.333 133.333,432.402 133.333,800C133.333,1167.6 432.402,1466.67 800,1466.67C1167.6,1466.67 1466.67,1167.6 1466.67,800C1466.67,432.402 1167.6,133.333 800,133.333ZM800,233.333C1113.55,233.333 1366.67,486.446 1366.67,800C1366.67,1113.55 1113.55,1366.67 800,1366.67C486.446,1366.67 233.333,1113.55 233.333,800C233.333,486.446 486.446,233.333 800,233.333ZM799.219,499.284C771.814,499.712 749.607,522.595 750,550L750,929.297L635.352,814.648C625.926,804.832 612.89,799.276 599.281,799.276C571.849,799.276 549.276,821.849 549.276,849.281C549.276,862.89 554.832,875.926 564.648,885.352L764.648,1085.35C784.044,1104.74 815.956,1104.74 835.352,1085.35L1035.35,885.352C1045.17,875.926 1050.72,862.89 1050.72,849.281C1050.72,821.849 1028.15,799.276 1000.72,799.276C987.11,799.276 974.074,804.832 964.648,814.648L850,929.297L850,550C850.003,549.761 850.005,549.522 850.005,549.283C850.005,521.851 827.432,499.278 800,499.278C799.74,499.278 799.479,499.28 799.219,499.284Z" style="fill-rule:nonzero;"/>
|
||||
</g></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
3
VDownload/Assets/Icons/StateErrorDark.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg fill="#FFFFFF" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600"><g transform="matrix(1.201,0,0,1.201,-160.8,-160.8)">
|
||||
<path d="M800,133.333C432.402,133.333 133.333,432.402 133.333,800C133.333,1167.6 432.402,1466.67 800,1466.67C1167.6,1466.67 1466.67,1167.6 1466.67,800C1466.67,432.402 1167.6,133.333 800,133.333ZM800,233.333C1113.55,233.333 1366.67,486.446 1366.67,800C1366.67,1113.55 1113.55,1366.67 800,1366.67C486.446,1366.67 233.333,1113.55 233.333,800C233.333,486.446 486.446,233.333 800,233.333ZM799.219,432.617C771.814,433.045 749.607,455.928 750,483.333L750,883.333C749.997,883.569 749.995,883.805 749.995,884.04C749.995,911.472 772.568,934.045 800,934.045C827.432,934.045 850.005,911.472 850.005,884.04C850.005,883.805 850.003,883.569 850,883.333L850,483.333C850.003,483.094 850.005,482.855 850.005,482.616C850.005,455.184 827.432,432.611 800,432.611C799.74,432.611 799.479,432.613 799.219,432.617ZM800,1033.33C763.428,1033.33 733.333,1063.43 733.333,1100C733.333,1136.57 763.428,1166.67 800,1166.67C836.572,1166.67 866.667,1136.57 866.667,1100C866.667,1063.43 836.572,1033.33 800,1033.33Z" style="fill-rule:nonzero;"/>
|
||||
</g></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
3
VDownload/Assets/Icons/StateErrorLight.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg fill="#000000" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600"><g transform="matrix(1.201,0,0,1.201,-160.8,-160.8)">
|
||||
<path d="M800,133.333C432.402,133.333 133.333,432.402 133.333,800C133.333,1167.6 432.402,1466.67 800,1466.67C1167.6,1466.67 1466.67,1167.6 1466.67,800C1466.67,432.402 1167.6,133.333 800,133.333ZM800,233.333C1113.55,233.333 1366.67,486.446 1366.67,800C1366.67,1113.55 1113.55,1366.67 800,1366.67C486.446,1366.67 233.333,1113.55 233.333,800C233.333,486.446 486.446,233.333 800,233.333ZM799.219,432.617C771.814,433.045 749.607,455.928 750,483.333L750,883.333C749.997,883.569 749.995,883.805 749.995,884.04C749.995,911.472 772.568,934.045 800,934.045C827.432,934.045 850.005,911.472 850.005,884.04C850.005,883.805 850.003,883.569 850,883.333L850,483.333C850.003,483.094 850.005,482.855 850.005,482.616C850.005,455.184 827.432,432.611 800,432.611C799.74,432.611 799.479,432.613 799.219,432.617ZM800,1033.33C763.428,1033.33 733.333,1063.43 733.333,1100C733.333,1136.57 763.428,1166.67 800,1166.67C836.572,1166.67 866.667,1136.57 866.667,1100C866.667,1063.43 836.572,1033.33 800,1033.33Z" style="fill-rule:nonzero;"/>
|
||||
</g></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
42
VDownload/Assets/Icons/StateFinalizingDark.svg
Normal file
@@ -0,0 +1,42 @@
|
||||
<svg fill="#FFFFFF" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<rect x="700" y="300" width="200" height="200"/>
|
||||
</g>
|
||||
<g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<rect x="900" y="500" width="200" height="200"/>
|
||||
</g>
|
||||
<g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<rect x="700" y="700" width="200" height="200"/>
|
||||
</g>
|
||||
<g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<rect x="500" y="500" width="200" height="200"/>
|
||||
</g>
|
||||
<g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<rect x="1100" y="700" width="200" height="200"/>
|
||||
</g>
|
||||
<g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<rect x="300" y="700" width="200" height="200"/>
|
||||
</g>
|
||||
<g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<rect x="500" y="900" width="200" height="200"/>
|
||||
</g>
|
||||
<g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<rect x="900" y="900" width="200" height="200"/>
|
||||
</g>
|
||||
<g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<rect x="700" y="1100" width="200" height="200"/>
|
||||
</g>
|
||||
<g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<path d="M500,1100L339.35,1100C381.15,1164.1 435.9,1218.8 500,1260.65L500,1100Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<path d="M1100,339.35L1100,500L1260.65,500C1218.8,435.9 1164.1,381.2 1100,339.35Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<path d="M339.35,500L500,500L500,339.35C435.9,381.2 381.2,435.9 339.35,500Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(-8.38883e-17,-1.37,-1.37,8.38883e-17,1895.11,1895.11)">
|
||||
<path d="M339.35,500L500,500L500,339.35C435.9,381.2 381.2,435.9 339.35,500Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(1.09602,0,0,1.08475,-153.251,-135.424)">
|
||||
<path d="M867,123C1269.35,123 1596,453.463 1596,860.5C1596,1267.54 1269.35,1598 867,1598C464.654,1598 138,1267.54 138,860.5C138,453.463 464.654,123 867,123ZM867,233.625C1208.99,233.625 1486.65,514.518 1486.65,860.5C1486.65,1206.48 1208.99,1487.38 867,1487.38C525.006,1487.38 247.35,1206.48 247.35,860.5C247.35,514.518 525.006,233.625 867,233.625Z"/>
|
||||
</g></svg>
|
||||
|
After Width: | Height: | Size: 2.3 KiB |
42
VDownload/Assets/Icons/StateFinalizingLight.svg
Normal file
@@ -0,0 +1,42 @@
|
||||
<svg fill="#000000" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<rect x="700" y="300" width="200" height="200"/>
|
||||
</g>
|
||||
<g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<rect x="900" y="500" width="200" height="200"/>
|
||||
</g>
|
||||
<g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<rect x="700" y="700" width="200" height="200"/>
|
||||
</g>
|
||||
<g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<rect x="500" y="500" width="200" height="200"/>
|
||||
</g>
|
||||
<g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<rect x="1100" y="700" width="200" height="200"/>
|
||||
</g>
|
||||
<g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<rect x="300" y="700" width="200" height="200"/>
|
||||
</g>
|
||||
<g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<rect x="500" y="900" width="200" height="200"/>
|
||||
</g>
|
||||
<g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<rect x="900" y="900" width="200" height="200"/>
|
||||
</g>
|
||||
<g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<rect x="700" y="1100" width="200" height="200"/>
|
||||
</g>
|
||||
<g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<path d="M500,1100L339.35,1100C381.15,1164.1 435.9,1218.8 500,1260.65L500,1100Z"/>
|
||||
</g>
|
||||
<g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<path d="M1100,339.35L1100,500L1260.65,500C1218.8,435.9 1164.1,381.2 1100,339.35Z"/>
|
||||
</g>
|
||||
<g transform="matrix(1.37,0,0,1.37,-296,-296)">
|
||||
<path d="M339.35,500L500,500L500,339.35C435.9,381.2 381.2,435.9 339.35,500Z"/>
|
||||
</g>
|
||||
<g transform="matrix(-8.38883e-17,-1.37,-1.37,8.38883e-17,1895.11,1895.11)">
|
||||
<path d="M339.35,500L500,500L500,339.35C435.9,381.2 381.2,435.9 339.35,500Z"/>
|
||||
</g>
|
||||
<g transform="matrix(1.09602,0,0,1.08475,-153.251,-135.424)">
|
||||
<path d="M867,123C1269.35,123 1596,453.463 1596,860.5C1596,1267.54 1269.35,1598 867,1598C464.654,1598 138,1267.54 138,860.5C138,453.463 464.654,123 867,123ZM867,233.625C1208.99,233.625 1486.65,514.518 1486.65,860.5C1486.65,1206.48 1208.99,1487.38 867,1487.38C525.006,1487.38 247.35,1206.48 247.35,860.5C247.35,514.518 525.006,233.625 867,233.625Z"/>
|
||||
</g></svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
3
VDownload/Assets/Icons/StateIdleDark.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg fill="#FFFFFF" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600"><g transform="matrix(1.201,0,0,1.201,-160.8,-160.8)">
|
||||
<path d="M800,133.333C432.402,133.333 133.333,432.402 133.333,800C133.333,1167.6 432.402,1466.67 800,1466.67C1167.6,1466.67 1466.67,1167.6 1466.67,800C1466.67,432.402 1167.6,133.333 800,133.333ZM800,233.333C1113.55,233.333 1366.67,486.446 1366.67,800C1366.67,1113.55 1113.55,1366.67 800,1366.67C486.446,1366.67 233.333,1113.55 233.333,800C233.333,486.446 486.446,233.333 800,233.333Z" style="fill-rule:nonzero;"/>
|
||||
</g></svg>
|
||||
|
After Width: | Height: | Size: 570 B |
3
VDownload/Assets/Icons/StateIdleLight.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg fill="#000000" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600"><g transform="matrix(1.201,0,0,1.201,-160.8,-160.8)">
|
||||
<path d="M800,133.333C432.402,133.333 133.333,432.402 133.333,800C133.333,1167.6 432.402,1466.67 800,1466.67C1167.6,1466.67 1466.67,1167.6 1466.67,800C1466.67,432.402 1167.6,133.333 800,133.333ZM800,233.333C1113.55,233.333 1366.67,486.446 1366.67,800C1366.67,1113.55 1113.55,1366.67 800,1366.67C486.446,1366.67 233.333,1113.55 233.333,800C233.333,486.446 486.446,233.333 800,233.333Z" style="fill-rule:nonzero;"/>
|
||||
</g></svg>
|
||||
|
After Width: | Height: | Size: 570 B |
18
VDownload/Assets/Icons/StateProcessingDark.svg
Normal file
@@ -0,0 +1,18 @@
|
||||
<svg fill="#FFFFFF" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600"><g transform="matrix(1.20108,0,0,1.20108,-160.865,-160.865)">
|
||||
<circle cx="800" cy="466.667" r="116.667" style="fill:none;stroke:white;stroke-width:100px;"/>
|
||||
</g>
|
||||
<g transform="matrix(1.20108,0,0,1.20108,-160.865,-160.865)">
|
||||
<circle cx="466.667" cy="800" r="116.667" style="fill:none;stroke:white;stroke-width:100px;"/>
|
||||
</g>
|
||||
<g transform="matrix(1.20108,0,0,1.20108,-160.865,-160.865)">
|
||||
<circle cx="800" cy="1133.33" r="116.667" style="fill:none;stroke:white;stroke-width:100px;"/>
|
||||
</g>
|
||||
<g transform="matrix(1.20108,0,0,1.20108,-160.865,-160.865)">
|
||||
<circle cx="1133.33" cy="800" r="116.667" style="fill:none;stroke:white;stroke-width:100px;"/>
|
||||
</g>
|
||||
<g transform="matrix(1.20108,0,0,1.20108,-160.865,-160.865)">
|
||||
<circle cx="800" cy="800" r="616.667" style="fill:none;stroke:white;stroke-width:100px;"/>
|
||||
</g>
|
||||
<g transform="matrix(1.20108,0,0,1.20108,-160.865,-160.865)">
|
||||
<circle cx="800" cy="800" r="66.667"/>
|
||||
</g></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
18
VDownload/Assets/Icons/StateProcessingLight.svg
Normal file
@@ -0,0 +1,18 @@
|
||||
<svg fill="#000000" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600"><g transform="matrix(1.20108,0,0,1.20108,-160.865,-160.865)">
|
||||
<circle cx="800" cy="466.667" r="116.667" style="fill:none;stroke:black;stroke-width:100px;"/>
|
||||
</g>
|
||||
<g transform="matrix(1.20108,0,0,1.20108,-160.865,-160.865)">
|
||||
<circle cx="466.667" cy="800" r="116.667" style="fill:none;stroke:black;stroke-width:100px;"/>
|
||||
</g>
|
||||
<g transform="matrix(1.20108,0,0,1.20108,-160.865,-160.865)">
|
||||
<circle cx="800" cy="1133.33" r="116.667" style="fill:none;stroke:black;stroke-width:100px;"/>
|
||||
</g>
|
||||
<g transform="matrix(1.20108,0,0,1.20108,-160.865,-160.865)">
|
||||
<circle cx="1133.33" cy="800" r="116.667" style="fill:none;stroke:black;stroke-width:100px;"/>
|
||||
</g>
|
||||
<g transform="matrix(1.20108,0,0,1.20108,-160.865,-160.865)">
|
||||
<circle cx="800" cy="800" r="616.667" style="fill:none;stroke:black;stroke-width:100px;"/>
|
||||
</g>
|
||||
<g transform="matrix(1.20108,0,0,1.20108,-160.865,-160.865)">
|
||||
<circle cx="800" cy="800" r="66.667"/>
|
||||
</g></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
3
VDownload/Assets/Icons/StateWaitingDark.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg fill="#FFFFFF" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600"><g transform="matrix(1.201,0,0,1.201,-160.8,-160.8)">
|
||||
<path d="M800,133.333C432.402,133.333 133.333,432.402 133.333,800C133.333,1167.6 432.402,1466.67 800,1466.67C1167.6,1466.67 1466.67,1167.6 1466.67,800C1466.67,432.402 1167.6,133.333 800,133.333ZM800,233.333C1113.55,233.333 1366.67,486.446 1366.67,800C1366.67,1113.55 1113.55,1366.67 800,1366.67C486.446,1366.67 233.333,1113.55 233.333,800C233.333,486.446 486.446,233.333 800,233.333ZM782.552,399.284C755.148,399.712 732.94,422.595 733.333,450L733.333,850C733.336,877.428 755.905,899.997 783.333,900L1050,900C1050.24,900.003 1050.47,900.005 1050.71,900.005C1078.14,900.005 1100.71,877.432 1100.71,850C1100.71,822.568 1078.14,799.995 1050.71,799.995C1050.47,799.995 1050.24,799.997 1050,800L833.333,800L833.333,450C833.337,449.761 833.338,449.522 833.338,449.283C833.338,421.851 810.765,399.278 783.333,399.278C783.073,399.278 782.813,399.28 782.552,399.284Z" style="fill-rule:nonzero;"/>
|
||||
</g></svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
3
VDownload/Assets/Icons/StateWaitingLight.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg fill="#000000" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600"><g transform="matrix(1.201,0,0,1.201,-160.8,-160.8)">
|
||||
<path d="M800,133.333C432.402,133.333 133.333,432.402 133.333,800C133.333,1167.6 432.402,1466.67 800,1466.67C1167.6,1466.67 1466.67,1167.6 1466.67,800C1466.67,432.402 1167.6,133.333 800,133.333ZM800,233.333C1113.55,233.333 1366.67,486.446 1366.67,800C1366.67,1113.55 1113.55,1366.67 800,1366.67C486.446,1366.67 233.333,1113.55 233.333,800C233.333,486.446 486.446,233.333 800,233.333ZM782.552,399.284C755.148,399.712 732.94,422.595 733.333,450L733.333,850C733.336,877.428 755.905,899.997 783.333,900L1050,900C1050.24,900.003 1050.47,900.005 1050.71,900.005C1078.14,900.005 1100.71,877.432 1100.71,850C1100.71,822.568 1078.14,799.995 1050.71,799.995C1050.47,799.995 1050.24,799.997 1050,800L833.333,800L833.333,450C833.337,449.761 833.338,449.522 833.338,449.283C833.338,421.851 810.765,399.278 783.333,399.278C783.073,399.278 782.813,399.28 782.552,399.284Z" style="fill-rule:nonzero;"/>
|
||||
</g></svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -1,3 +1,3 @@
|
||||
<svg fill="#FFFFFF" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600"><g transform="matrix(1.11651,0,0,1.11651,-114.651,-186.605)">
|
||||
<svg fill="#000000" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600"><g transform="matrix(1.11651,0,0,1.11651,-114.651,-186.605)">
|
||||
<path d="M283.333,233.333C182.233,233.333 100,315.6 100,416.667L100,1183.33C100,1284.4 182.233,1366.67 283.333,1366.67L733.333,1366.67C733.333,1330.87 741.718,1297.03 756.185,1266.67L283.333,1266.67C237.4,1266.67 200,1229.3 200,1183.33L200,416.667C200,370.7 237.4,333.333 283.333,333.333L1316.67,333.333C1362.6,333.333 1400,370.7 1400,416.667L1400,701.693C1418.73,704.393 1437.12,711.141 1453.32,723.307C1479.05,742.607 1494.56,770.5 1498.83,800L1500,800L1500,416.667C1500,315.6 1417.77,233.333 1316.67,233.333L283.333,233.333ZM283.333,400C264.933,400 250,414.933 250,433.333L250,466.667C250,485.067 264.933,500 283.333,500L316.667,500C335.067,500 350,485.067 350,466.667L350,433.333C350,414.933 335.067,400 316.667,400L283.333,400ZM483.333,400C464.933,400 450,414.933 450,433.333L450,466.667C450,485.067 464.933,500 483.333,500L516.667,500C535.067,500 550,485.067 550,466.667L550,433.333C550,414.933 535.067,400 516.667,400L483.333,400ZM683.333,400C664.933,400 650,414.933 650,433.333L650,466.667C650,485.067 664.933,500 683.333,500L716.667,500C735.067,500 750,485.067 750,466.667L750,433.333C750,414.933 735.067,400 716.667,400L683.333,400ZM883.333,400C864.933,400 850,414.933 850,433.333L850,466.667C850,485.067 864.933,500 883.333,500L916.667,500C935.067,500 950,485.067 950,466.667L950,433.333C950,414.933 935.067,400 916.667,400L883.333,400ZM1083.33,400C1064.93,400 1050,414.933 1050,433.333L1050,466.667C1050,485.067 1064.93,500 1083.33,500L1116.67,500C1135.07,500 1150,485.067 1150,466.667L1150,433.333C1150,414.933 1135.07,400 1116.67,400L1083.33,400ZM1283.33,400C1264.93,400 1250,414.933 1250,433.333L1250,466.667C1250,485.067 1264.93,500 1283.33,500L1316.67,500C1335.07,500 1350,485.067 1350,466.667L1350,433.333C1350,414.933 1335.07,400 1316.67,400L1283.33,400ZM1386.2,765.625C1369.3,764.93 1353.15,772.857 1343.36,786.654L1158.98,1032.42L955.273,784.896C945.741,772.99 931.267,766.078 916.016,766.146C888.67,766.271 866.239,788.805 866.239,816.15C866.239,827.969 870.429,839.413 878.06,848.438L1097.2,1114.78L1025.72,1210.03C1007.54,1203.65 987.694,1200 966.667,1200C915.278,1200 870.405,1221.07 841.797,1253.26C813.189,1285.44 800,1326.39 800,1366.67C800,1406.94 813.189,1447.89 841.797,1480.08C870.405,1512.26 915.278,1533.33 966.667,1533.33C1018.06,1533.33 1062.93,1512.26 1091.54,1480.08C1120.14,1447.89 1133.33,1406.94 1133.33,1366.67C1133.33,1333.5 1123.82,1300.16 1104.69,1271.35L1162.57,1194.21L1227.41,1273.05C1209.06,1301.47 1200,1334.16 1200,1366.67C1200,1406.94 1213.19,1447.89 1241.8,1480.08C1270.4,1512.26 1315.28,1533.33 1366.67,1533.33C1418.06,1533.33 1462.93,1512.26 1491.54,1480.08C1520.14,1447.89 1533.33,1406.94 1533.33,1366.67C1533.33,1326.39 1520.14,1285.44 1491.54,1253.26C1462.93,1221.07 1418.06,1200 1366.67,1200C1344.9,1200 1324.42,1203.94 1305.73,1210.74L1224.35,1111.91L1423.31,846.68C1430.33,837.839 1434.15,826.876 1434.15,815.588C1434.15,788.931 1412.83,766.72 1386.2,765.625ZM283.333,1100C264.933,1100 250,1114.93 250,1133.33L250,1166.67C250,1185.07 264.933,1200 283.333,1200L316.667,1200C335.067,1200 350,1185.07 350,1166.67L350,1133.33C350,1114.93 335.067,1100 316.667,1100L283.333,1100ZM483.333,1100C464.933,1100 450,1114.93 450,1133.33L450,1166.67C450,1185.07 464.933,1200 483.333,1200L516.667,1200C535.067,1200 550,1185.07 550,1166.67L550,1133.33C550,1114.93 535.067,1100 516.667,1100L483.333,1100ZM683.333,1100C664.933,1100 650,1114.93 650,1133.33L650,1166.67C650,1185.07 664.933,1200 683.333,1200L716.667,1200C735.067,1200 750,1185.07 750,1166.67L750,1133.33C750,1114.93 735.067,1100 716.667,1100L683.333,1100ZM966.667,1300C979.861,1300 989.903,1302.06 997.852,1305.53C1003.13,1312.89 1010.31,1318.67 1018.62,1322.27C1027.7,1333.76 1033.33,1349.82 1033.33,1366.67C1033.33,1384.72 1027.08,1402.11 1016.8,1413.67C1006.52,1425.24 993.056,1433.33 966.667,1433.33C940.278,1433.33 926.817,1425.24 916.536,1413.67C906.256,1402.11 900,1384.72 900,1366.67C900,1348.61 906.256,1331.23 916.536,1319.66C926.817,1308.1 940.278,1300 966.667,1300ZM1366.67,1300C1393.06,1300 1406.52,1308.1 1416.8,1319.66C1427.08,1331.23 1433.33,1348.61 1433.33,1366.67C1433.33,1384.72 1427.08,1402.11 1416.8,1413.67C1406.52,1425.24 1393.06,1433.33 1366.67,1433.33C1340.28,1433.33 1326.82,1425.24 1316.54,1413.67C1306.26,1402.11 1300,1384.72 1300,1366.67C1300,1349.41 1305.81,1332.89 1315.3,1321.35C1322.81,1317.95 1329.37,1312.74 1334.38,1306.18C1342.54,1302.35 1352.73,1300 1366.67,1300Z" style="fill-rule:nonzero;"/>
|
||||
</g></svg>
|
||||
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 267 KiB After Width: | Height: | Size: 267 KiB |
14
VDownload/Resources/Colors.xaml
Normal file
@@ -0,0 +1,14 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<SolidColorBrush x:Key="HomeBackgroundColor" Color="#F5F5F5"/>
|
||||
<SolidColorBrush x:Key="HomeOptionBarBackgroundColor" Color="#F5F5F5"/>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<SolidColorBrush x:Key="HomeBackgroundColor" Color="#252525"/>
|
||||
<SolidColorBrush x:Key="HomeOptionBarBackgroundColor" Color="#1B1B1B"/>
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
</ResourceDictionary>
|
||||
@@ -1,6 +1,9 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
|
||||
<!-- THEMED ICONS -->
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<SvgImageSource x:Key="AuthorIcon" UriSource="ms-appx:///Assets/Icons/AuthorLight.svg"/>
|
||||
@@ -12,6 +15,14 @@
|
||||
<SvgImageSource x:Key="TrimIcon" UriSource="ms-appx:///Assets/Icons/TrimLight.svg"/>
|
||||
<SvgImageSource x:Key="FileIcon" UriSource="ms-appx:///Assets/Icons/FileLight.svg"/>
|
||||
<SvgImageSource x:Key="LocationIcon" UriSource="ms-appx:///Assets/Icons/LocationLight.svg"/>
|
||||
<SvgImageSource x:Key="StateIdleIcon" UriSource="ms-appx:///Assets/Icons/StateIdleLight.svg"/>
|
||||
<SvgImageSource x:Key="StateWaitingIcon" UriSource="ms-appx:///Assets/Icons/StateWaitingLight.svg"/>
|
||||
<SvgImageSource x:Key="StateCancelledIcon" UriSource="ms-appx:///Assets/Icons/StateCancelledLight.svg"/>
|
||||
<SvgImageSource x:Key="StateDownloadingIcon" UriSource="ms-appx:///Assets/Icons/StateDownloadingLight.svg"/>
|
||||
<SvgImageSource x:Key="StateErrorIcon" UriSource="ms-appx:///Assets/Icons/StateErrorLight.svg"/>
|
||||
<SvgImageSource x:Key="StateDoneIcon" UriSource="ms-appx:///Assets/Icons/StateDoneLight.svg"/>
|
||||
<SvgImageSource x:Key="StateFinalizingIcon" UriSource="ms-appx:///Assets/Icons/StateFinalizingLight.svg"/>
|
||||
<SvgImageSource x:Key="StateProcessingIcon" UriSource="ms-appx:///Assets/Icons/StateProcessingLight.svg"/>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<SvgImageSource x:Key="AuthorIcon" UriSource="ms-appx:///Assets/Icons/AuthorDark.svg"/>
|
||||
@@ -23,7 +34,22 @@
|
||||
<SvgImageSource x:Key="TrimIcon" UriSource="ms-appx:///Assets/Icons/TrimDark.svg"/>
|
||||
<SvgImageSource x:Key="FileIcon" UriSource="ms-appx:///Assets/Icons/FileDark.svg"/>
|
||||
<SvgImageSource x:Key="LocationIcon" UriSource="ms-appx:///Assets/Icons/LocationDark.svg"/>
|
||||
<SvgImageSource x:Key="StateIdleIcon" UriSource="ms-appx:///Assets/Icons/StateIdleDark.svg"/>
|
||||
<SvgImageSource x:Key="StateWaitingIcon" UriSource="ms-appx:///Assets/Icons/StateWaitingDark.svg"/>
|
||||
<SvgImageSource x:Key="StateCancelledIcon" UriSource="ms-appx:///Assets/Icons/StateCancelledDark.svg"/>
|
||||
<SvgImageSource x:Key="StateDownloadingIcon" UriSource="ms-appx:///Assets/Icons/StateDownloadingDark.svg"/>
|
||||
<SvgImageSource x:Key="StateErrorIcon" UriSource="ms-appx:///Assets/Icons/StateErrorDark.svg"/>
|
||||
<SvgImageSource x:Key="StateDoneIcon" UriSource="ms-appx:///Assets/Icons/StateDoneDark.svg"/>
|
||||
<SvgImageSource x:Key="StateFinalizingIcon" UriSource="ms-appx:///Assets/Icons/StateFinalizingDark.svg"/>
|
||||
<SvgImageSource x:Key="StateProcessingIcon" UriSource="ms-appx:///Assets/Icons/StateProcessingDark.svg"/>
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
|
||||
|
||||
<!-- SOURCE ICONS -->
|
||||
<BitmapImage x:Key="TwitchIcon" UriSource="ms-appx:///Assets/Icons/Twitch.png"/>
|
||||
|
||||
|
||||
<!-- OTHER ICONS-->
|
||||
<SvgImageSource x:Key="ErrorIcon" UriSource="ms-appx:///Assets/Icons/Error.svg"/>
|
||||
</ResourceDictionary>
|
||||
|
||||
@@ -220,6 +220,27 @@ The number in the numberbox indicades how many videos will be got from playlist.
|
||||
<data name="HomeVideoAddingTrimSettingControl.Title" xml:space="preserve">
|
||||
<value>Trim</value>
|
||||
</data>
|
||||
<data name="HomeVideoPanelStateTextCancelled" xml:space="preserve">
|
||||
<value>Cancelled</value>
|
||||
</data>
|
||||
<data name="HomeVideoPanelStateTextDone" xml:space="preserve">
|
||||
<value>Done</value>
|
||||
</data>
|
||||
<data name="HomeVideoPanelStateTextDownloading" xml:space="preserve">
|
||||
<value>Downloading</value>
|
||||
</data>
|
||||
<data name="HomeVideoPanelStateTextFinalizing" xml:space="preserve">
|
||||
<value>Finalizing</value>
|
||||
</data>
|
||||
<data name="HomeVideoPanelStateTextIdle" xml:space="preserve">
|
||||
<value>Idle</value>
|
||||
</data>
|
||||
<data name="HomeVideoPanelStateTextProcessing" xml:space="preserve">
|
||||
<value>Processing</value>
|
||||
</data>
|
||||
<data name="HomeVideoPanelStateTextWaiting" xml:space="preserve">
|
||||
<value>Queued</value>
|
||||
</data>
|
||||
<data name="MainPageNavigationPanelHomeItem.Content" xml:space="preserve">
|
||||
<value>Home</value>
|
||||
</data>
|
||||
|
||||
@@ -140,6 +140,7 @@
|
||||
<Compile Include="Views\Home\HomeVideoAddingPanel.xaml.cs">
|
||||
<DependentUpon>HomeVideoAddingPanel.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Home\HomeVideosList.cs" />
|
||||
<Compile Include="Views\Home\HomeVideoPanel.xaml.cs">
|
||||
<DependentUpon>HomeVideoPanel.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -177,6 +178,22 @@
|
||||
<Content Include="Assets\Icons\MediaTypeLight.svg" />
|
||||
<Content Include="Assets\Icons\QualityDark.svg" />
|
||||
<Content Include="Assets\Icons\QualityLight.svg" />
|
||||
<Content Include="Assets\Icons\StateCancelledDark.svg" />
|
||||
<Content Include="Assets\Icons\StateCancelledLight.svg" />
|
||||
<Content Include="Assets\Icons\StateDoneDark.svg" />
|
||||
<Content Include="Assets\Icons\StateDoneLight.svg" />
|
||||
<Content Include="Assets\Icons\StateDownloadingDark.svg" />
|
||||
<Content Include="Assets\Icons\StateDownloadingLight.svg" />
|
||||
<Content Include="Assets\Icons\StateErrorDark.svg" />
|
||||
<Content Include="Assets\Icons\StateErrorLight.svg" />
|
||||
<Content Include="Assets\Icons\StateFinalizingDark.svg" />
|
||||
<Content Include="Assets\Icons\StateFinalizingLight.svg" />
|
||||
<Content Include="Assets\Icons\StateIdleDark.svg" />
|
||||
<Content Include="Assets\Icons\StateIdleLight.svg" />
|
||||
<Content Include="Assets\Icons\StateProcessingDark.svg" />
|
||||
<Content Include="Assets\Icons\StateProcessingLight.svg" />
|
||||
<Content Include="Assets\Icons\StateWaitingDark.svg" />
|
||||
<Content Include="Assets\Icons\StateWaitingLight.svg" />
|
||||
<Content Include="Assets\Icons\TrimDark.svg" />
|
||||
<Content Include="Assets\Icons\TrimLight.svg" />
|
||||
<Content Include="Assets\Icons\ViewsDark.svg" />
|
||||
@@ -232,7 +249,7 @@
|
||||
<Content Include="Assets\Logo\Wide310x150Logo.scale-150.png" />
|
||||
<Content Include="Assets\Logo\Wide310x150Logo.scale-200.png" />
|
||||
<Content Include="Assets\Logo\Wide310x150Logo.scale-400.png" />
|
||||
<Content Include="Assets\Twitch.png" />
|
||||
<Content Include="Assets\Icons\Twitch.png" />
|
||||
<Content Include="Assets\UnknownThumbnail.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -240,6 +257,10 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="Resources\Colors.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Resources\Converters.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -13,18 +13,9 @@
|
||||
|
||||
<Page.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<SolidColorBrush x:Key="HomeMainOptionBarBackgroundColor" Color="#1B1B1B"/>
|
||||
<SolidColorBrush x:Key="HomeMainAddingPanelBackgroundColor" Color="#212121"/>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<SolidColorBrush x:Key="HomeMainOptionBarBackgroundColor" Color="#F5F5F5"/>
|
||||
<SolidColorBrush x:Key="HomeMainAddingPanelBackgroundColor" Color="#F5F5F5"/>
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="ms-appx:///Resources/Icons.xaml"/>
|
||||
<ResourceDictionary Source="ms-appx:///Resources/Colors.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Page.Resources>
|
||||
@@ -68,16 +59,16 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- VIDEOS LIST -->
|
||||
<StackPanel/>
|
||||
<StackPanel x:Name="HomeVideosList"/>
|
||||
|
||||
<!-- OPTIONS BAR AND ADDING PANEL -->
|
||||
<Grid Grid.Row="1" CornerRadius="{ThemeResource ControlCornerRadius}" Background="{ThemeResource HomeMainAddingPanelBackgroundColor}">
|
||||
<Grid Grid.Row="1" CornerRadius="{ThemeResource ControlCornerRadius}" Background="{ThemeResource HomeBackgroundColor}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ContentControl x:Name="HomeAddingPanel" Grid.Row="0" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"/> <!-- Adding Panel -->
|
||||
<Grid x:Name="HomeOptionsBar" Grid.Row="1" Background="{ThemeResource HomeMainOptionBarBackgroundColor}"> <!-- Options Bar -->
|
||||
<Grid x:Name="HomeOptionsBar" Grid.Row="1" Background="{ThemeResource HomeOptionBarBackgroundColor}"> <!-- Options Bar -->
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
@@ -96,7 +87,7 @@
|
||||
<AppBarToggleButton x:Name="HomeOptionsBarAddPlaylistButton" x:Uid="HomeOptionsBarAddPlaylistButton" Icon="List" Label="Add playlist" Width="85" Checked="HomeOptionsBarAddPlaylistButton_Checked" Unchecked="HomeOptionsBarAddingButtons_Unchecked"/>
|
||||
<AppBarToggleButton x:Name="HomeOptionsBarAddVideoButton" x:Uid="HomeOptionsBarAddVideoButton" Icon="Video" Label="Add video" Width="75" Checked="HomeOptionsBarAddVideoButton_Checked" Unchecked="HomeOptionsBarAddingButtons_Unchecked"/>
|
||||
<AppBarSeparator VerticalAlignment="Center" Height="50"/>
|
||||
<AppBarButton x:Name="HomeOptionsBarDownloadAllButton" x:Uid="HomeOptionsBarDownloadAllButton" Icon="Download" Label="Download All" Width="90"/>
|
||||
<AppBarButton x:Name="HomeOptionsBarDownloadAllButton" x:Uid="HomeOptionsBarDownloadAllButton" Icon="Download" Label="Download All" Width="90" Click="HomeOptionsBarDownloadAllButton_Click"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Threading;
|
||||
using VDownload.Core.Enums;
|
||||
@@ -30,8 +31,8 @@ namespace VDownload.Views.Home
|
||||
#region PROPERTIES
|
||||
|
||||
// SEARCHING STATUS CONTROLS
|
||||
private readonly Microsoft.UI.Xaml.Controls.ProgressRing HomeOptionsBarSearchingStatusProgressRing = new Microsoft.UI.Xaml.Controls.ProgressRing { Width = 15, Height = 15, Margin = new Thickness(5), IsActive = true};
|
||||
private readonly Image HomeOptionsBarSearchingStatusErrorImage = new Image { Width = 15, Height = 15, Margin = new Thickness(5), Source = (SvgImageSource)new ResourceDictionary { Source = new Uri("ms-appx:///Resources/Icons.xaml")}["ErrorIcon"] };
|
||||
private readonly Microsoft.UI.Xaml.Controls.ProgressRing HomeOptionsBarSearchingStatusProgressRing = new Microsoft.UI.Xaml.Controls.ProgressRing { Width = 15, Height = 15, Margin = new Thickness(5), IsActive = true };
|
||||
private readonly Image HomeOptionsBarSearchingStatusErrorImage = new Image { Width = 15, Height = 15, Margin = new Thickness(5), Source = (SvgImageSource)new ResourceDictionary { Source = new Uri("ms-appx:///Resources/Icons.xaml") }["ErrorIcon"] };
|
||||
|
||||
CancellationTokenSource SearchingCancellationToken = new CancellationTokenSource();
|
||||
|
||||
@@ -149,7 +150,22 @@ namespace VDownload.Views.Home
|
||||
|
||||
private void HomeVideoAddingPanel_VideoAddRequest(object sender, VideoAddEventArgs e)
|
||||
{
|
||||
// Uncheck video button
|
||||
HomeOptionsBarAddVideoButton.IsChecked = false;
|
||||
|
||||
// Create video panel/task
|
||||
HomeVideoPanel videoPanel = new HomeVideoPanel(e.VideoService, e.MediaType, e.Stream, e.TrimStart, e.TrimEnd, e.Filename, e.Extension, e.Location);
|
||||
|
||||
videoPanel.VideoRemovingRequested += (s, a) =>
|
||||
{
|
||||
// Remove video panel/task from videos list
|
||||
HomeVideosList.Children.Remove(videoPanel);
|
||||
Home.HomeVideosList.VideoList.Remove(videoPanel);
|
||||
};
|
||||
|
||||
// Add video panel/task to videos list
|
||||
HomeVideosList.Children.Add(videoPanel);
|
||||
Home.HomeVideosList.VideoList.Add(videoPanel);
|
||||
}
|
||||
|
||||
|
||||
@@ -261,6 +277,12 @@ namespace VDownload.Views.Home
|
||||
HomeOptionsBarSearchingStatusControl.Content = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
// DOWNLOAD ALL BUTTON CLICKED
|
||||
private async void HomeOptionsBarDownloadAllButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
foreach (HomeVideoPanel videoPanel in Home.HomeVideosList.VideoList.Where(video => video.VideoStatus == VideoStatus.Idle)) await videoPanel.Start();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,9 +216,9 @@
|
||||
<cc:SettingControl x:Uid="HomeVideoAddingTrimSettingControl" Icon="{ThemeResource TrimIcon}">
|
||||
<cc:SettingControl.SettingContent>
|
||||
<StackPanel Orientation="Horizontal" Spacing="5">
|
||||
<TextBox x:Name="HomeVideoAddingTrimStartTextBox" ex:TextBoxExtensions.CustomMask="{x:Bind VideoData.Duration, Converter={StaticResource TimeSpanToTextBoxMaskElementsConverter}}" ex:TextBoxExtensions.Mask="{x:Bind VideoData.Duration, Converter={StaticResource TimeSpanToTextBoxMaskConverter}}" TextChanged="HomeVideoAddingTrimStartTextBox_TextChanged"/>
|
||||
<TextBox x:Name="HomeVideoAddingTrimStartTextBox" ex:TextBoxExtensions.CustomMask="{x:Bind VideoService.Duration, Converter={StaticResource TimeSpanToTextBoxMaskElementsConverter}}" ex:TextBoxExtensions.Mask="{x:Bind VideoService.Duration, Converter={StaticResource TimeSpanToTextBoxMaskConverter}}" TextChanged="HomeVideoAddingTrimStartTextBox_TextChanged"/>
|
||||
<TextBlock VerticalAlignment="Center" Text="-"/>
|
||||
<TextBox x:Name="HomeVideoAddingTrimEndTextBox" ex:TextBoxExtensions.CustomMask="{x:Bind VideoData.Duration, Converter={StaticResource TimeSpanToTextBoxMaskElementsConverter}}" ex:TextBoxExtensions.Mask="{x:Bind VideoData.Duration, Converter={StaticResource TimeSpanToTextBoxMaskConverter}}" TextChanged="HomeVideoAddingTrimEndTextBox_TextChanged"/>
|
||||
<TextBox x:Name="HomeVideoAddingTrimEndTextBox" ex:TextBoxExtensions.CustomMask="{x:Bind VideoService.Duration, Converter={StaticResource TimeSpanToTextBoxMaskElementsConverter}}" ex:TextBoxExtensions.Mask="{x:Bind VideoService.Duration, Converter={StaticResource TimeSpanToTextBoxMaskConverter}}" TextChanged="HomeVideoAddingTrimEndTextBox_TextChanged"/>
|
||||
</StackPanel>
|
||||
</cc:SettingControl.SettingContent>
|
||||
</cc:SettingControl>
|
||||
|
||||
@@ -28,21 +28,21 @@ namespace VDownload.Views.Home
|
||||
{
|
||||
#region CONSTRUCTORS
|
||||
|
||||
public HomeVideoAddingPanel(IVideoService videoData)
|
||||
public HomeVideoAddingPanel(IVideoService videoService)
|
||||
{
|
||||
this.InitializeComponent();
|
||||
|
||||
// Set video service object
|
||||
VideoData = videoData;
|
||||
VideoService = videoService;
|
||||
|
||||
// Set metadata
|
||||
ThumbnailImage = new BitmapImage { UriSource = VideoData.Thumbnail ?? new Uri("ms-appx:///Assets/UnknownThumbnail.png") };
|
||||
SourceImage = new BitmapIcon { ShowAsMonochrome = false, UriSource = new Uri($"ms-appx:///Assets/{VideoData.GetType().Namespace.Split(".").Last()}.png") };
|
||||
Title = VideoData.Title;
|
||||
Author = VideoData.Author;
|
||||
Views = VideoData.Views.ToString();
|
||||
Date = VideoData.Date.ToString(CultureInfo.InstalledUICulture.DateTimeFormat.ShortDatePattern);
|
||||
Duration = $"{Math.Floor(VideoData.Duration.TotalHours):00}:{VideoData.Duration.Minutes:00}:{VideoData.Duration.Seconds:00}";
|
||||
ThumbnailImage = new BitmapImage { UriSource = VideoService.Thumbnail ?? new Uri("ms-appx:///Assets/UnknownThumbnail.png") };
|
||||
SourceImage = new BitmapIcon { UriSource = new Uri($"ms-appx:///Assets/Icons/{VideoService.GetType().Namespace.Split(".").Last()}.png"), ShowAsMonochrome = false };
|
||||
Title = VideoService.Title;
|
||||
Author = VideoService.Author;
|
||||
Views = VideoService.Views.ToString();
|
||||
Date = VideoService.Date.ToString(CultureInfo.InstalledUICulture.DateTimeFormat.ShortDatePattern);
|
||||
Duration = $"{(Math.Floor(VideoService.Duration.TotalHours) > 0 ? $"{Math.Floor(VideoService.Duration.TotalHours):0}:" : "")}{VideoService.Duration.Minutes:00}:{VideoService.Duration.Seconds:00}";
|
||||
|
||||
|
||||
// Set media type
|
||||
@@ -53,49 +53,50 @@ namespace VDownload.Views.Home
|
||||
HomeVideoAddingMediaTypeSettingControlComboBox.SelectedIndex = (int)Config.GetValue("default_media_type");
|
||||
|
||||
// Set quality
|
||||
foreach (Stream stream in VideoData.Streams)
|
||||
foreach (Stream stream in VideoService.Streams)
|
||||
{
|
||||
HomeVideoAddingQualitySettingControlComboBox.Items.Add($"{stream.Height}p{(stream.FrameRate > 0 ? stream.FrameRate.ToString() : "N/A")}");
|
||||
}
|
||||
HomeVideoAddingQualitySettingControlComboBox.SelectedIndex = 0;
|
||||
|
||||
// Set trim start
|
||||
if (Math.Floor(VideoData.Duration.TotalHours) > 0) HomeVideoAddingTrimStartTextBox.Text += $"{new string('0', Math.Floor(VideoData.Duration.TotalHours).ToString().Length)}:";
|
||||
if (Math.Floor(VideoData.Duration.TotalMinutes) > 0) HomeVideoAddingTrimStartTextBox.Text += Math.Floor(VideoData.Duration.TotalHours) > 0 ? "00:" : $"{new string('0', VideoData.Duration.Minutes.ToString().Length)}:";
|
||||
HomeVideoAddingTrimStartTextBox.Text += Math.Floor(VideoData.Duration.TotalMinutes) > 0 ? "00" : $"{new string('0', VideoData.Duration.Seconds.ToString().Length)}";
|
||||
if (Math.Floor(VideoService.Duration.TotalHours) > 0) HomeVideoAddingTrimStartTextBox.Text += $"{new string('0', Math.Floor(VideoService.Duration.TotalHours).ToString().Length)}:";
|
||||
if (Math.Floor(VideoService.Duration.TotalMinutes) > 0) HomeVideoAddingTrimStartTextBox.Text += Math.Floor(VideoService.Duration.TotalHours) > 0 ? "00:" : $"{new string('0', VideoService.Duration.Minutes.ToString().Length)}:";
|
||||
HomeVideoAddingTrimStartTextBox.Text += Math.Floor(VideoService.Duration.TotalMinutes) > 0 ? "00" : $"{new string('0', VideoService.Duration.Seconds.ToString().Length)}";
|
||||
|
||||
// Set trim end
|
||||
if (Math.Floor(VideoData.Duration.TotalHours) > 0) HomeVideoAddingTrimEndTextBox.Text += $"{Math.Floor(VideoData.Duration.TotalHours)}:";
|
||||
if (Math.Floor(VideoData.Duration.TotalMinutes) > 0) HomeVideoAddingTrimEndTextBox.Text += Math.Floor(VideoData.Duration.TotalHours) > 0 ? $"{VideoData.Duration.Minutes:00}:" : $"{VideoData.Duration.Minutes}:";
|
||||
HomeVideoAddingTrimEndTextBox.Text += Math.Floor(VideoData.Duration.TotalMinutes) > 0 ? $"{VideoData.Duration.Seconds:00}" : $"{VideoData.Duration.Seconds}";
|
||||
if (Math.Floor(VideoService.Duration.TotalHours) > 0) HomeVideoAddingTrimEndTextBox.Text += $"{Math.Floor(VideoService.Duration.TotalHours)}:";
|
||||
if (Math.Floor(VideoService.Duration.TotalMinutes) > 0) HomeVideoAddingTrimEndTextBox.Text += Math.Floor(VideoService.Duration.TotalHours) > 0 ? $"{VideoService.Duration.Minutes:00}:" : $"{VideoService.Duration.Minutes}:";
|
||||
HomeVideoAddingTrimEndTextBox.Text += Math.Floor(VideoService.Duration.TotalMinutes) > 0 ? $"{VideoService.Duration.Seconds:00}" : $"{VideoService.Duration.Seconds}";
|
||||
|
||||
// Set filename
|
||||
string temporaryFilename = (string)Config.GetValue("default_filename");
|
||||
Dictionary<string, string> filenameStandardTemplates = new Dictionary<string, string>()
|
||||
{
|
||||
{ "<title>", VideoData.Title },
|
||||
{ "<author>", VideoData.Author },
|
||||
{ "<views>", VideoData.Views.ToString() },
|
||||
{ "<id>", VideoData.ID },
|
||||
{ "<title>", VideoService.Title },
|
||||
{ "<author>", VideoService.Author },
|
||||
{ "<views>", VideoService.Views.ToString() },
|
||||
{ "<id>", VideoService.ID },
|
||||
};
|
||||
foreach (KeyValuePair<string, string> template in filenameStandardTemplates) temporaryFilename = temporaryFilename.Replace(template.Key, template.Value);
|
||||
Dictionary<Regex, IFormattable> filenameFormatTemplates = new Dictionary<Regex, IFormattable>()
|
||||
{
|
||||
{ new Regex(@"<date_pub:(?<format>.*)>"), VideoData.Date },
|
||||
{ new Regex(@"<date_pub:(?<format>.*)>"), VideoService.Date },
|
||||
{ new Regex(@"<date_now:(?<format>.*)>"), DateTime.Now },
|
||||
{ new Regex(@"<duration:(?<format>.*)>"), VideoData.Duration },
|
||||
{ new Regex(@"<duration:(?<format>.*)>"), VideoService.Duration },
|
||||
};
|
||||
foreach (KeyValuePair<Regex, IFormattable> template in filenameFormatTemplates) foreach (Match templateMatch in template.Key.Matches(temporaryFilename)) temporaryFilename = temporaryFilename.Replace(templateMatch.Value, template.Value.ToString(templateMatch.Groups["format"].Value, null));
|
||||
HomeVideoAddingFilenameTextBox.Text = temporaryFilename;
|
||||
Filename = temporaryFilename;
|
||||
|
||||
// Set location
|
||||
if ((DefaultLocationType)Config.GetValue("default_location_type") == DefaultLocationType.Last && StorageApplicationPermissions.FutureAccessList.ContainsItem("last_media_location"))
|
||||
if (!(bool)Config.GetValue("custom_media_location") && StorageApplicationPermissions.FutureAccessList.ContainsItem("last_media_location"))
|
||||
{
|
||||
Task<StorageFolder> task = StorageApplicationPermissions.FutureAccessList.GetFolderAsync("last_media_location").AsTask();
|
||||
Location = task.Result;
|
||||
HomeVideoAddingLocationSettingControl.Description = Location.Path;
|
||||
}
|
||||
else if ((DefaultLocationType)Config.GetValue("default_location_type") == DefaultLocationType.Selected && StorageApplicationPermissions.FutureAccessList.ContainsItem("selected_media_location"))
|
||||
else if ((bool)Config.GetValue("custom_media_location") && StorageApplicationPermissions.FutureAccessList.ContainsItem("custom_media_location"))
|
||||
{
|
||||
Task<StorageFolder> task = StorageApplicationPermissions.FutureAccessList.GetFolderAsync("selected_media_location").AsTask();
|
||||
Location = task.Result;
|
||||
@@ -115,7 +116,7 @@ namespace VDownload.Views.Home
|
||||
#region PROPERTIES
|
||||
|
||||
// BASE VIDEO DATA
|
||||
private IVideoService VideoData { get; set; }
|
||||
private IVideoService VideoService { get; set; }
|
||||
|
||||
// VIDEO DATA
|
||||
private ImageSource ThumbnailImage { get; set; }
|
||||
@@ -148,7 +149,7 @@ namespace VDownload.Views.Home
|
||||
if (HomeVideoAddingMediaTypeSettingControlComboBox.SelectedIndex == (int)MediaType.OnlyAudio)
|
||||
{
|
||||
HomeVideoAddingQualitySettingControl.Visibility = Visibility.Collapsed;
|
||||
HomeVideoAddingQualitySettingControlComboBox.SelectedIndex = VideoData.Streams.Count() - 1;
|
||||
HomeVideoAddingQualitySettingControlComboBox.SelectedIndex = VideoService.Streams.Count() - 1;
|
||||
|
||||
HomeVideoAddingExtensionComboBox.Items.Clear();
|
||||
foreach (AudioFileExtension extension in Enum.GetValues(typeof(AudioFileExtension)))
|
||||
@@ -174,7 +175,7 @@ namespace VDownload.Views.Home
|
||||
// QUALITY COMBOBOX SELECTION CHANGED
|
||||
private void HomeVideoAddingQualitySettingControlComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
Stream = VideoData.Streams[HomeVideoAddingQualitySettingControlComboBox.SelectedIndex];
|
||||
Stream = VideoService.Streams[HomeVideoAddingQualitySettingControlComboBox.SelectedIndex];
|
||||
}
|
||||
|
||||
// TRIM START TEXTBOX TEXT CHANGED
|
||||
@@ -189,15 +190,15 @@ namespace VDownload.Views.Home
|
||||
|
||||
TimeSpan parsedTimeSpan = new TimeSpan(hours, minutes, seconds);
|
||||
|
||||
if (parsedTimeSpan < VideoData.Duration && parsedTimeSpan > new TimeSpan(0)) TrimStart = parsedTimeSpan;
|
||||
if (parsedTimeSpan < VideoService.Duration && parsedTimeSpan > new TimeSpan(0)) TrimStart = parsedTimeSpan;
|
||||
else
|
||||
{
|
||||
TrimStart = new TimeSpan(0);
|
||||
|
||||
string newText = string.Empty;
|
||||
if (Math.Floor(VideoData.Duration.TotalHours) > 0) newText += $"{new string('0', Math.Floor(VideoData.Duration.TotalHours).ToString().Length)}:";
|
||||
if (Math.Floor(VideoData.Duration.TotalMinutes) > 0) newText += Math.Floor(VideoData.Duration.TotalHours) > 0 ? "00:" : $"{new string('0', VideoData.Duration.Minutes.ToString().Length)}:";
|
||||
newText += Math.Floor(VideoData.Duration.TotalMinutes) > 0 ? "00" : $"{new string('0', VideoData.Duration.Seconds.ToString().Length)}";
|
||||
if (Math.Floor(VideoService.Duration.TotalHours) > 0) newText += $"{new string('0', Math.Floor(VideoService.Duration.TotalHours).ToString().Length)}:";
|
||||
if (Math.Floor(VideoService.Duration.TotalMinutes) > 0) newText += Math.Floor(VideoService.Duration.TotalHours) > 0 ? "00:" : $"{new string('0', VideoService.Duration.Minutes.ToString().Length)}:";
|
||||
newText += Math.Floor(VideoService.Duration.TotalMinutes) > 0 ? "00" : $"{new string('0', VideoService.Duration.Seconds.ToString().Length)}";
|
||||
|
||||
if (newText != HomeVideoAddingTrimStartTextBox.Text) HomeVideoAddingTrimStartTextBox.Text = newText;
|
||||
}
|
||||
@@ -216,15 +217,15 @@ namespace VDownload.Views.Home
|
||||
|
||||
TimeSpan parsedTimeSpan = new TimeSpan(hours, minutes, seconds);
|
||||
|
||||
if (parsedTimeSpan < VideoData.Duration && parsedTimeSpan > new TimeSpan(0)) TrimEnd = parsedTimeSpan;
|
||||
if (parsedTimeSpan < VideoService.Duration && parsedTimeSpan > new TimeSpan(0)) TrimEnd = parsedTimeSpan;
|
||||
else
|
||||
{
|
||||
TrimEnd = VideoData.Duration;
|
||||
TrimEnd = VideoService.Duration;
|
||||
|
||||
string newText = string.Empty;
|
||||
if (Math.Floor(VideoData.Duration.TotalHours) > 0) newText += $"{Math.Floor(VideoData.Duration.TotalHours)}:";
|
||||
if (Math.Floor(VideoData.Duration.TotalMinutes) > 0) newText += Math.Floor(VideoData.Duration.TotalHours) > 0 ? $"{TrimEnd.Minutes:00}:" : $"{TrimEnd.Minutes}:";
|
||||
newText += Math.Floor(VideoData.Duration.TotalMinutes) > 0 ? $"{TrimEnd.Seconds:00}" : $"{TrimEnd.Seconds}";
|
||||
if (Math.Floor(VideoService.Duration.TotalHours) > 0) newText += $"{Math.Floor(VideoService.Duration.TotalHours)}:";
|
||||
if (Math.Floor(VideoService.Duration.TotalMinutes) > 0) newText += Math.Floor(VideoService.Duration.TotalHours) > 0 ? $"{TrimEnd.Minutes:00}:" : $"{TrimEnd.Minutes}:";
|
||||
newText += Math.Floor(VideoService.Duration.TotalMinutes) > 0 ? $"{TrimEnd.Seconds:00}" : $"{TrimEnd.Seconds}";
|
||||
|
||||
if (newText != HomeVideoAddingTrimEndTextBox.Text) HomeVideoAddingTrimEndTextBox.Text = newText;
|
||||
}
|
||||
@@ -237,7 +238,11 @@ namespace VDownload.Views.Home
|
||||
string oldFilename = HomeVideoAddingFilenameTextBox.Text;
|
||||
string newFilename = oldFilename;
|
||||
foreach (char c in System.IO.Path.GetInvalidFileNameChars()) newFilename = newFilename.Replace(c, ' ');
|
||||
if (oldFilename != newFilename) HomeVideoAddingFilenameTextBox.Text = newFilename;
|
||||
if (oldFilename != newFilename)
|
||||
{
|
||||
HomeVideoAddingFilenameTextBox.Text = newFilename;
|
||||
Filename = newFilename;
|
||||
}
|
||||
}
|
||||
|
||||
// EXTENSION COMBOBOX SELECTION CHANGED
|
||||
@@ -274,7 +279,7 @@ namespace VDownload.Views.Home
|
||||
public async void HomeVideoAddingPanelSourceButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// Launch the website
|
||||
await Windows.System.Launcher.LaunchUriAsync(VideoData.VideoUrl);
|
||||
await Windows.System.Launcher.LaunchUriAsync(VideoService.VideoUrl);
|
||||
}
|
||||
|
||||
// ADD BUTTON CLICKED
|
||||
@@ -282,7 +287,7 @@ namespace VDownload.Views.Home
|
||||
{
|
||||
VideoAddEventArgs args = new VideoAddEventArgs
|
||||
{
|
||||
VideoService = VideoData,
|
||||
VideoService = VideoService,
|
||||
MediaType = MediaType,
|
||||
Stream = Stream,
|
||||
TrimStart = TrimStart,
|
||||
|
||||
@@ -4,12 +4,59 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:VDownload.Views.Home"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300"
|
||||
d:DesignWidth="400">
|
||||
d:DesignHeight="150"
|
||||
d:DesignWidth="800">
|
||||
|
||||
<Grid>
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="ms-appx:///Resources/Icons.xaml"/>
|
||||
<ResourceDictionary Source="ms-appx:///Resources/Colors.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
<x:String x:Key="MetadataIconSize">14</x:String>
|
||||
<x:String x:Key="MetadataTextSize">11</x:String>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid Background="{ThemeResource HomeBackgroundColor}" Padding="10" ColumnSpacing="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Grid.Row="0" Grid.RowSpan="3" Grid.Column="0" Height="120" Source="{x:Bind ThumbnailImage}"/>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" FontSize="18" VerticalAlignment="Center" FontWeight="SemiBold" Text="{x:Bind Title}"/>
|
||||
<Grid Grid.Row="1" Grid.RowSpan="2" Grid.Column="1" ColumnSpacing="5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Grid.Row="0" Grid.Column="0" Width="{StaticResource MetadataIconSize}" Source="{ThemeResource QualityIcon}"/>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" VerticalAlignment="Center" FontSize="{StaticResource MetadataTextSize}" Text="{x:Bind MediaTypeQuality}"/>
|
||||
<Image Grid.Row="1" Grid.Column="0" Width="{StaticResource MetadataIconSize}" Source="{ThemeResource DurationIcon}"/>
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" VerticalAlignment="Center" FontSize="{StaticResource MetadataTextSize}" Text="{x:Bind Duration}"/>
|
||||
<Image Grid.Row="2" Grid.Column="0" Width="{StaticResource MetadataIconSize}" Source="{ThemeResource FileIcon}"/>
|
||||
<TextBlock Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" VerticalAlignment="Center" FontSize="{StaticResource MetadataTextSize}" Text="{x:Bind File}"/>
|
||||
<Image x:Name="HomeVideoPanelStateIcon" Grid.Row="3" Grid.Column="0" Width="{StaticResource MetadataIconSize}"/>
|
||||
<TextBlock x:Name="HomeVideoPanelStateText" Grid.Row="3" Grid.Column="1" VerticalAlignment="Center" FontSize="{StaticResource MetadataTextSize}"/>
|
||||
<muxc:ProgressBar x:Name="HomeVideoPanelStateProgressBar" Grid.Row="3" Grid.Column="2" Margin="10,0,0,0" VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
<AppBarButton Grid.Row="0" Grid.Column="2" VerticalAlignment="Center" Width="40" Height="48" Margin="-3" Icon="{x:Bind SourceImage}" Click="HomeVideoPanelSourceButton_Click"/>
|
||||
<AppBarButton x:Name="HomeVideoPanelStartStopButton" Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" Width="40" Height="48" Margin="-3" Icon="Download" Click="HomeVideoPanelStartStopButton_Click"/>
|
||||
<AppBarButton Grid.Row="2" Grid.Column="2" VerticalAlignment="Center" Width="40" Height="48" Margin="-3" Icon="Cancel" Click="HomeVideoPanelRemoveButton_Click"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using VDownload.Core.Enums;
|
||||
using VDownload.Core.Interfaces;
|
||||
using VDownload.Core.Objects;
|
||||
using VDownload.Core.Services;
|
||||
using Windows.ApplicationModel.ExtendedExecution;
|
||||
using Windows.ApplicationModel.Resources;
|
||||
using Windows.Storage;
|
||||
using Windows.Storage.AccessCache;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Controls.Primitives;
|
||||
using Windows.UI.Xaml.Data;
|
||||
using Windows.UI.Xaml.Input;
|
||||
using Windows.UI.Xaml.Media;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
using Windows.UI.Xaml.Media.Imaging;
|
||||
|
||||
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
|
||||
|
||||
@@ -19,9 +22,253 @@ namespace VDownload.Views.Home
|
||||
{
|
||||
public sealed partial class HomeVideoPanel : UserControl
|
||||
{
|
||||
public HomeVideoPanel()
|
||||
#region CONSTANTS
|
||||
|
||||
ResourceDictionary IconsRes = new ResourceDictionary { Source = new Uri("ms-appx:///Resources/Icons.xaml") };
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region CONSTRUCTORS
|
||||
|
||||
public HomeVideoPanel(IVideoService videoService, MediaType mediaType, Stream stream, TimeSpan trimStart, TimeSpan trimEnd, string filename, MediaFileExtension extension, StorageFolder location)
|
||||
{
|
||||
this.InitializeComponent();
|
||||
|
||||
// Set video status
|
||||
VideoStatus = VideoStatus.Idle;
|
||||
|
||||
// Set video service object
|
||||
VideoService = videoService;
|
||||
|
||||
// Create video cancellation token
|
||||
CancellationTokenSource = new CancellationTokenSource();
|
||||
|
||||
// Set video options
|
||||
MediaType = mediaType;
|
||||
Stream = stream;
|
||||
TrimStart = trimStart;
|
||||
TrimEnd = trimEnd;
|
||||
Filename = filename;
|
||||
Extension = extension;
|
||||
Location = location;
|
||||
|
||||
// Set metadata
|
||||
ThumbnailImage = new BitmapImage { UriSource = VideoService.Thumbnail ?? new Uri("ms-appx:///Assets/UnknownThumbnail.png") };
|
||||
SourceImage = new BitmapIcon { UriSource = new Uri($"ms-appx:///Assets/Icons/{VideoService.GetType().Namespace.Split(".").Last()}.png"), ShowAsMonochrome = false };
|
||||
Title = VideoService.Title;
|
||||
Author = VideoService.Author;
|
||||
TimeSpan newDuration = TrimEnd.Subtract(TrimStart);
|
||||
Duration += $"{(Math.Floor(newDuration.TotalHours) > 0 ? $"{Math.Floor(newDuration.TotalHours):0}:" : "")}{newDuration.Minutes:00}:{newDuration.Seconds:00}";
|
||||
if (VideoService.Duration > newDuration) Duration += $" ({(Math.Floor(TrimStart.TotalHours) > 0 || Math.Floor(TrimEnd.TotalHours) > 0 ? $"{Math.Floor(TrimStart.TotalHours):0}:" : "")}{TrimStart.Minutes:00}:{TrimStart.Seconds:00} - {(Math.Floor(TrimStart.TotalHours) > 0 || Math.Floor(TrimEnd.TotalHours) > 0 ? $"{Math.Floor(TrimEnd.TotalHours):0}:" : "")}{TrimEnd.Minutes:00}:{TrimEnd.Seconds:00})";
|
||||
MediaTypeQuality += ResourceLoader.GetForCurrentView().GetString($"MediaType{MediaType}Text");
|
||||
if (MediaType != MediaType.OnlyAudio) MediaTypeQuality += $" ({Stream.Height}p{(Stream.FrameRate > 0 ? Stream.FrameRate.ToString() : "N/A")})";
|
||||
File += $@"{(Location != null ? Location.Path : $@"{UserDataPaths.GetDefault().Downloads}\VDownload")}\{Filename}.{Extension.ToString().ToLower()}";
|
||||
|
||||
// Set state controls
|
||||
HomeVideoPanelStateIcon.Source = (SvgImageSource)IconsRes["StateIdleIcon"];
|
||||
HomeVideoPanelStateText.Text = ResourceLoader.GetForCurrentView().GetString("HomeVideoPanelStateTextIdle");
|
||||
HomeVideoPanelStateProgressBar.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region PROPERTIES
|
||||
|
||||
// VIDEO STATUS
|
||||
public VideoStatus VideoStatus { get; set; }
|
||||
|
||||
// VIDEO CANECELLATION TOKEN
|
||||
public CancellationTokenSource CancellationTokenSource { get; set; }
|
||||
|
||||
// VIDEO SERVICE
|
||||
private IVideoService VideoService { get; set; }
|
||||
|
||||
// VIDEO OPTIONS
|
||||
private MediaType MediaType { get; set; }
|
||||
private Stream Stream { get; set; }
|
||||
private TimeSpan TrimStart { get; set; }
|
||||
private TimeSpan TrimEnd { get; set; }
|
||||
private string Filename { get; set; }
|
||||
private MediaFileExtension Extension { get; set; }
|
||||
private StorageFolder Location { get; set; }
|
||||
|
||||
// VIDEO PANEL DATA
|
||||
private ImageSource ThumbnailImage { get; set; }
|
||||
private IconElement SourceImage { get; set; }
|
||||
private string Title { get; set; }
|
||||
private string Author { get; set; }
|
||||
private string Duration { get; set; }
|
||||
private string MediaTypeQuality { get; set; }
|
||||
private string File { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region METHODS
|
||||
|
||||
public async Task Start()
|
||||
{
|
||||
// Change icon
|
||||
HomeVideoPanelStartStopButton.Icon = new SymbolIcon(Symbol.Stop);
|
||||
|
||||
// Create cancellation token
|
||||
CancellationTokenSource = new CancellationTokenSource();
|
||||
|
||||
// Set video status
|
||||
VideoStatus = VideoStatus.Waiting;
|
||||
|
||||
// Set state controls
|
||||
HomeVideoPanelStateIcon.Source = (SvgImageSource)IconsRes["StateWaitingIcon"];
|
||||
HomeVideoPanelStateText.Text = ResourceLoader.GetForCurrentView().GetString("HomeVideoPanelStateTextWaiting");
|
||||
HomeVideoPanelStateProgressBar.Visibility = Visibility.Visible;
|
||||
HomeVideoPanelStateProgressBar.IsIndeterminate = true;
|
||||
|
||||
// Wait in queue
|
||||
await HomeVideosList.WaitInQueue(CancellationTokenSource.Token);
|
||||
|
||||
// Get task unique ID
|
||||
string uniqueID = HomeVideosList.GetUniqueID();
|
||||
|
||||
// Get temporary folder
|
||||
StorageFolder tempFolder;
|
||||
if ((bool)Config.GetValue("custom_temp_location") && StorageApplicationPermissions.FutureAccessList.ContainsItem("custom_temp_location"))
|
||||
tempFolder = await StorageApplicationPermissions.FutureAccessList.GetFolderAsync("custom_temp_location");
|
||||
else
|
||||
tempFolder = ApplicationData.Current.TemporaryFolder;
|
||||
tempFolder = await tempFolder.CreateFolderAsync(uniqueID);
|
||||
|
||||
try
|
||||
{
|
||||
// Set cancellation token to throw exception on request
|
||||
CancellationTokenSource.Token.ThrowIfCancellationRequested();
|
||||
|
||||
// Set video status
|
||||
VideoStatus = VideoStatus.InProgress;
|
||||
|
||||
// Start stopwatch
|
||||
Stopwatch taskStopwatch = Stopwatch.StartNew();
|
||||
|
||||
// Set progress event handlers
|
||||
VideoService.DownloadingStarted += (s, a) =>
|
||||
{
|
||||
HomeVideoPanelStateIcon.Source = (SvgImageSource)IconsRes["StateDownloadingIcon"];
|
||||
HomeVideoPanelStateText.Text = $"{ResourceLoader.GetForCurrentView().GetString("HomeVideoPanelStateTextDownloading")} (0%)";
|
||||
HomeVideoPanelStateProgressBar.IsIndeterminate = false;
|
||||
HomeVideoPanelStateProgressBar.Value = 0;
|
||||
};
|
||||
VideoService.DownloadingProgressChanged += (s, a) =>
|
||||
{
|
||||
HomeVideoPanelStateIcon.Source = (SvgImageSource)IconsRes["StateDownloadingIcon"];
|
||||
HomeVideoPanelStateText.Text = $"{ResourceLoader.GetForCurrentView().GetString("HomeVideoPanelStateTextDownloading")} ({a.ProgressPercentage}%)";
|
||||
HomeVideoPanelStateProgressBar.Value = a.ProgressPercentage;
|
||||
};
|
||||
VideoService.ProcessingStarted += (s, a) =>
|
||||
{
|
||||
HomeVideoPanelStateIcon.Source = (SvgImageSource)IconsRes["StateProcessingIcon"];
|
||||
HomeVideoPanelStateText.Text = $"{ResourceLoader.GetForCurrentView().GetString("HomeVideoPanelStateTextProcessing")} (0%)";
|
||||
HomeVideoPanelStateProgressBar.Value = 0;
|
||||
};
|
||||
VideoService.ProcessingProgressChanged += (s, a) =>
|
||||
{
|
||||
HomeVideoPanelStateIcon.Source = (SvgImageSource)IconsRes["StateProcessingIcon"];
|
||||
HomeVideoPanelStateText.Text = $"{ResourceLoader.GetForCurrentView().GetString("HomeVideoPanelStateTextProcessing")} ({a.ProgressPercentage}%)";
|
||||
HomeVideoPanelStateProgressBar.Value = a.ProgressPercentage;
|
||||
};
|
||||
|
||||
// Request extended session
|
||||
ExtendedExecutionSession session = new ExtendedExecutionSession { Reason = ExtendedExecutionReason.Unspecified };
|
||||
await session.RequestExtensionAsync();
|
||||
|
||||
// Start task
|
||||
StorageFile tempOutputFile = await VideoService.DownloadAndTranscodeAsync(tempFolder, Stream, Extension, MediaType, CancellationTokenSource.Token);
|
||||
|
||||
// Dispose session
|
||||
session.Dispose();
|
||||
|
||||
// Cancel if requested
|
||||
CancellationTokenSource.Token.ThrowIfCancellationRequested();
|
||||
|
||||
// Set state controls
|
||||
HomeVideoPanelStateIcon.Source = (SvgImageSource)IconsRes["StateFinalizingIcon"];
|
||||
HomeVideoPanelStateText.Text = ResourceLoader.GetForCurrentView().GetString("HomeVideoPanelStateTextFinalizing");
|
||||
HomeVideoPanelStateProgressBar.IsIndeterminate = true;
|
||||
|
||||
// Move to output location
|
||||
StorageFile outputFile;
|
||||
if (Location != null) outputFile = await Location.CreateFileAsync($"{Filename}.{Extension.ToString().ToLower()}", (bool)Config.GetValue("replace_output_file_if_exists") ? CreationCollisionOption.ReplaceExisting : CreationCollisionOption.GenerateUniqueName);
|
||||
else outputFile = await DownloadsFolder.CreateFileAsync($"{Filename}.{Extension.ToString().ToLower()}", (bool)Config.GetValue("replace_output_file_if_exists") ? CreationCollisionOption.ReplaceExisting : CreationCollisionOption.GenerateUniqueName);
|
||||
await tempOutputFile.MoveAndReplaceAsync(outputFile);
|
||||
|
||||
// Stop stopwatch
|
||||
taskStopwatch.Stop();
|
||||
|
||||
// Set state controls
|
||||
HomeVideoPanelStateIcon.Source = (SvgImageSource)IconsRes["StateDoneIcon"];
|
||||
HomeVideoPanelStateText.Text = $"{ResourceLoader.GetForCurrentView().GetString("HomeVideoPanelStateTextDone")} ({(Math.Floor(taskStopwatch.Elapsed.TotalHours) > 0 ? $"{ Math.Floor(taskStopwatch.Elapsed.TotalHours):0}:" : "")}{taskStopwatch.Elapsed.Minutes:00}:{taskStopwatch.Elapsed.Seconds:00})";
|
||||
HomeVideoPanelStateProgressBar.Visibility = Visibility.Collapsed;
|
||||
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
// Set state controls
|
||||
HomeVideoPanelStateIcon.Source = (SvgImageSource)IconsRes["StateCancelledIcon"];
|
||||
HomeVideoPanelStateText.Text = ResourceLoader.GetForCurrentView().GetString("HomeVideoPanelStateTextCancelled");
|
||||
HomeVideoPanelStateProgressBar.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
// Change icon
|
||||
HomeVideoPanelStartStopButton.Icon = new SymbolIcon(Symbol.Download);
|
||||
|
||||
// Set video status
|
||||
VideoStatus = VideoStatus.Idle;
|
||||
|
||||
// Delete temporary files
|
||||
await tempFolder.DeleteAsync();
|
||||
|
||||
// Dispose unique id
|
||||
HomeVideosList.DisposeUniqueID(uniqueID);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region EVENT HANDLERS VOIDS
|
||||
|
||||
// SOURCE BUTTON CLICKED
|
||||
private async void HomeVideoPanelSourceButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// Launch the website
|
||||
await Windows.System.Launcher.LaunchUriAsync(VideoService.VideoUrl);
|
||||
}
|
||||
|
||||
// START STOP BUTTON CLICKED
|
||||
private async void HomeVideoPanelStartStopButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (VideoStatus == VideoStatus.InProgress || VideoStatus == VideoStatus.Waiting) CancellationTokenSource.Cancel();
|
||||
else await Start();
|
||||
}
|
||||
|
||||
// REMOVE BUTTON CLICKED
|
||||
private void HomeVideoPanelRemoveButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (VideoStatus == VideoStatus.InProgress || VideoStatus == VideoStatus.Waiting) CancellationTokenSource.Cancel();
|
||||
VideoRemovingRequested?.Invoke(sender, EventArgs.Empty);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region EVENT HANDLERS
|
||||
|
||||
public event EventHandler VideoRemovingRequested;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
58
VDownload/Views/Home/HomeVideosList.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using VDownload.Core.Services;
|
||||
|
||||
namespace VDownload.Views.Home
|
||||
{
|
||||
public class HomeVideosList
|
||||
{
|
||||
// VIDEO OBJECTS LIST
|
||||
public static List<HomeVideoPanel> VideoList = new List<HomeVideoPanel>();
|
||||
|
||||
// WAIT IN QUEUE
|
||||
public static async Task WaitInQueue(CancellationToken token)
|
||||
{
|
||||
await Task.Run(async () =>
|
||||
{
|
||||
while (!(VideoList.Where(video => video.VideoStatus == Core.Enums.VideoStatus.InProgress).Count() < (int)Config.GetValue("max_active_video_task")) && !token.IsCancellationRequested)
|
||||
{
|
||||
await Task.Delay(50);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
#region GET UNIQUE ID
|
||||
|
||||
// VARIABLES
|
||||
private static readonly Random Random = new Random();
|
||||
private static readonly char[] CharsID = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890".ToCharArray();
|
||||
private static readonly int LengthID = 10;
|
||||
private static readonly List<string> UsedIDs = new List<string>();
|
||||
|
||||
// METHOD
|
||||
public static string GetUniqueID()
|
||||
{
|
||||
string id;
|
||||
do
|
||||
{
|
||||
id = "";
|
||||
while (id.Length < LengthID)
|
||||
{
|
||||
id += CharsID[Random.Next(0, CharsID.Length)];
|
||||
}
|
||||
} while (UsedIDs.Contains(id));
|
||||
UsedIDs.Add(id);
|
||||
return id;
|
||||
}
|
||||
|
||||
public static void DisposeUniqueID(string id)
|
||||
{
|
||||
UsedIDs.Remove(id);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,11 @@
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
|
||||
|
||||
<Page.Resources>
|
||||
<ResourceDictionary Source="ms-appx:///Resources/Icons.xaml"/>
|
||||
</Page.Resources>
|
||||
|
||||
|
||||
<Grid Padding="20">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
@@ -22,10 +27,7 @@
|
||||
|
||||
<!-- CONTENT -->
|
||||
<StackPanel Grid.Row="2" Spacing="10">
|
||||
<cc:SettingControl x:Name="SourcesTwitchSettingControl" x:Uid="SourcesTwitchSettingControl" Grid.Row="0" Title="Twitch"> <!-- Twitch -->
|
||||
<cc:SettingControl.Icon>
|
||||
<BitmapImage UriSource="ms-appx:///Assets/Twitch.png"/>
|
||||
</cc:SettingControl.Icon>
|
||||
<cc:SettingControl x:Name="SourcesTwitchSettingControl" x:Uid="SourcesTwitchSettingControl" Grid.Row="0" Icon="{StaticResource TwitchIcon}" Title="Twitch"> <!-- Twitch -->
|
||||
<cc:SettingControl.SettingContent>
|
||||
<Button x:Name="SourcesTwitchLoginButton" IsEnabled="False" Click="SourcesTwitchLoginButton_Click"/>
|
||||
</cc:SettingControl.SettingContent>
|
||||
|
||||