mirror of
https://github.com/PredatH0r/ChanSort.git
synced 2026-05-07 03:27:03 +02:00
- fixed "Export to Excel" (copies the list as tab-separated text into clipboard)
- included latest translation to Polish (thanks to J.D.) - reorganized File menu and tool bar - allow renaming channels in SatcoDX channel lists (\*.sdx) - improved support for Panasonic LS 500 / LX 700 series
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -32,6 +33,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -42,6 +44,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>..\Release\</OutputPath>
|
||||
@@ -52,6 +55,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
|
||||
@@ -108,5 +108,22 @@ namespace ChanSort.Loader.SatcoDX
|
||||
this.ShortName = shortName.TrimEnd();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Export()
|
||||
public void Export(byte[] buffer, Encoding encoding)
|
||||
{
|
||||
Array.Copy(this.data, this.FileOffset, buffer, 0, this.Length + 1);
|
||||
if (!this.IsNameModified)
|
||||
return;
|
||||
|
||||
// 43-50 + 115-126 in version 103 or 115-131 in version 105: channel name
|
||||
var bytes = encoding.GetBytes(this.Name);
|
||||
Tools.MemSet(buffer, 43, 32, 8);
|
||||
Tools.MemSet(buffer, 115, 32, buffer.Length - 115 -1);
|
||||
Array.Copy(bytes, 0, buffer, 43, Math.Min(bytes.Length, 8));
|
||||
if (bytes.Length > 8)
|
||||
Array.Copy(bytes, 8, buffer, 115, Math.Min(bytes.Length - 8, this.Length - 115 - 1));
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ namespace ChanSort.Loader.SatcoDX
|
||||
|
||||
public Serializer(string inputFile) : base(inputFile)
|
||||
{
|
||||
this.Features.ChannelNameEdit = ChannelNameEditMode.None;
|
||||
this.Features.ChannelNameEdit = ChannelNameEditMode.All;
|
||||
this.Features.DeleteMode = DeleteMode.Physically;
|
||||
this.Features.CanSkipChannels = false;
|
||||
this.Features.CanLockChannels = false;
|
||||
@@ -79,19 +79,22 @@ namespace ChanSort.Loader.SatcoDX
|
||||
this.FileName = tvOutputFile;
|
||||
}
|
||||
|
||||
using (var file = new FileStream(tvOutputFile, FileMode.Create))
|
||||
using var file = new FileStream(tvOutputFile, FileMode.Create);
|
||||
byte[] buffer = null;
|
||||
foreach (var channel in this.allChannels.GetChannelsByNewOrder())
|
||||
{
|
||||
foreach (var channel in this.allChannels.GetChannelsByNewOrder())
|
||||
{
|
||||
// when a reference list was applied, the list may contain proxy entries for deleted channels, which must be ignored
|
||||
if (channel.IsProxy || channel.IsDeleted)
|
||||
continue;
|
||||
if (channel is Channel realChannel)
|
||||
file.Write(this.content, realChannel.FileOffset, realChannel.Length + 1);
|
||||
}
|
||||
// when a reference list was applied, the list may contain proxy entries for deleted channels, which must be ignored
|
||||
if (channel.IsProxy || channel.IsDeleted)
|
||||
continue;
|
||||
if (channel is not Channel realChannel)
|
||||
continue;
|
||||
|
||||
file.Write(this.content, this.trailingDataPos, this.content.Length - this.trailingDataPos);
|
||||
buffer ??= new byte[realChannel.Length + 1];
|
||||
realChannel.Export(buffer, this.DefaultEncoding);
|
||||
file.Write(buffer, 0, buffer.Length);
|
||||
}
|
||||
|
||||
file.Write(this.content, this.trailingDataPos, this.content.Length - this.trailingDataPos);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -106,7 +109,7 @@ namespace ChanSort.Loader.SatcoDX
|
||||
get => base.DefaultEncoding;
|
||||
set
|
||||
{
|
||||
if (value == this.DefaultEncoding)
|
||||
if (ReferenceEquals(value, this.DefaultEncoding))
|
||||
return;
|
||||
base.DefaultEncoding = value;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user