Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make tracks dragable #399

Merged
merged 31 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2fb4807
Renamed tracklist component
NeoCoderMatrix86 Nov 8, 2024
584dfa1
Update Cuesheet.cs
NeoCoderMatrix86 Nov 11, 2024
add2c80
More components for tracklist
NeoCoderMatrix86 Nov 11, 2024
c1e0f0f
Update TrackList.razor
NeoCoderMatrix86 Nov 11, 2024
b810485
Add tracklink component
NeoCoderMatrix86 Nov 11, 2024
f82d25f
Update TrackListItem.razor
NeoCoderMatrix86 Nov 11, 2024
4b8bd98
New component for tracklist control column
NeoCoderMatrix86 Nov 11, 2024
c3c5635
add update after tracemanager changes
NeoCoderMatrix86 Nov 12, 2024
3f25e68
added localization for TrackSelection
NeoCoderMatrix86 Nov 12, 2024
9f11a2d
Moved localization
NeoCoderMatrix86 Nov 12, 2024
73d993d
Moved localization for track control column
NeoCoderMatrix86 Nov 12, 2024
ae75c48
Moved localization for track list item
NeoCoderMatrix86 Nov 12, 2024
f70a639
Fixed display of sections for track
NeoCoderMatrix86 Nov 12, 2024
640ef81
Update CuesheetTests.cs
NeoCoderMatrix86 Nov 12, 2024
e1a60e8
Moved test project namespace
NeoCoderMatrix86 Nov 12, 2024
6526742
Changed events to use list of tracks
NeoCoderMatrix86 Nov 12, 2024
8528d92
Update TrackListItem.razor
NeoCoderMatrix86 Nov 26, 2024
97bf70a
Update TrackListItem.razor
NeoCoderMatrix86 Nov 26, 2024
7ba89d5
updated libraries
NeoCoderMatrix86 Dec 2, 2024
da740a6
Update AudioCuesheetEditor.csproj
NeoCoderMatrix86 Dec 2, 2024
2c11d8b
Update AudioCuesheetEditor.csproj
NeoCoderMatrix86 Dec 2, 2024
91918cb
Fix for drag n drop
NeoCoderMatrix86 Dec 4, 2024
1216e65
Merge branch 'development' into 203-make-tracks-dragable
NeoCoderMatrix86 Dec 4, 2024
aa6fb1e
Update AudioCuesheetEditor.csproj
NeoCoderMatrix86 Dec 4, 2024
3c929ac
fixing build problem
NeoCoderMatrix86 Dec 4, 2024
660c423
Update AudioCuesheetEditor.csproj
NeoCoderMatrix86 Dec 4, 2024
5893825
updated libraries
NeoCoderMatrix86 Dec 4, 2024
e3cf96d
Update TrackListItem.razor
NeoCoderMatrix86 Dec 5, 2024
4c4d6f8
Update library.js
NeoCoderMatrix86 Dec 12, 2024
199c42e
Removed dead code
NeoCoderMatrix86 Dec 12, 2024
191a51e
removed all drag n drop stuff
NeoCoderMatrix86 Dec 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.2" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//<http: //www.gnu.org/licenses />.
using AudioCuesheetEditor.Model.AudioCuesheet;
using AudioCuesheetEditor.Model.UI;
using AudioCuesheetEditorTests.Utility;
using AudioCuesheetEditor.Tests.Utility;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace AudioCuesheetEditor.Extensions.Tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,11 @@
//You should have received a copy of the GNU General Public License
//along with Foobar. If not, see
//<http: //www.gnu.org/licenses />.
using Microsoft.VisualStudio.TestTools.UnitTesting;
using AudioCuesheetEditor.Model.AudioCuesheet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AudioCuesheetEditorTests.Utility;
using AudioCuesheetEditor.Model.Entity;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace AudioCuesheetEditor.Model.AudioCuesheet.Tests
namespace AudioCuesheetEditor.Tests.Model.AudioCuesheet
{
[TestClass()]
public class CataloguenumberTests
Expand All @@ -31,13 +26,13 @@ public class CataloguenumberTests
public void CatalogueNumberTest()
{
var catalogueNumber = new Cataloguenumber();
Assert.AreEqual(Entity.ValidationStatus.NoValidation, catalogueNumber.Validate().Status);
Assert.AreEqual(ValidationStatus.NoValidation, catalogueNumber.Validate().Status);
catalogueNumber.Value = "Testvalue";
Assert.AreEqual(Entity.ValidationStatus.Error, catalogueNumber.Validate().Status);
Assert.AreEqual(ValidationStatus.Error, catalogueNumber.Validate().Status);
catalogueNumber.Value = "01234567891234567890";
Assert.AreEqual(Entity.ValidationStatus.Error, catalogueNumber.Validate().Status);
Assert.AreEqual(ValidationStatus.Error, catalogueNumber.Validate().Status);
catalogueNumber.Value = "1234567890123";
Assert.AreEqual(Entity.ValidationStatus.Success, catalogueNumber.Validate().Status);
Assert.AreEqual(ValidationStatus.Success, catalogueNumber.Validate().Status);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,25 @@
//<http: //www.gnu.org/licenses />.
using AudioCuesheetEditor.Data.Options;
using AudioCuesheetEditor.Extensions;
using AudioCuesheetEditor.Model.AudioCuesheet;
using AudioCuesheetEditor.Model.Entity;
using AudioCuesheetEditor.Model.IO.Audio;
using AudioCuesheetEditor.Model.IO.Import;
using AudioCuesheetEditor.Model.Options;
using AudioCuesheetEditor.Model.UI;
using AudioCuesheetEditor.Services.IO;
using AudioCuesheetEditorTests.Properties;
using AudioCuesheetEditorTests.Utility;
using AudioCuesheetEditor.Tests.Properties;
using AudioCuesheetEditor.Tests.Utility;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

namespace AudioCuesheetEditor.Model.AudioCuesheet.Tests
namespace AudioCuesheetEditor.Tests.Model.AudioCuesheet
{
[TestClass()]
public class CuesheetTests
Expand All @@ -41,15 +43,12 @@ public void AddTrackTest()
{
var testHelper = new TestHelper();
var cuesheet = new Cuesheet();
var trackAddedFired = false;
cuesheet.TrackAdded += delegate
{
trackAddedFired = true;
};
AutoResetEvent tracksAddedEvent = new(false);
cuesheet.TracksAdded += (object? sender, TracksAddedRemovedEventArgs args) => tracksAddedEvent.Set();
Assert.AreEqual(cuesheet.Tracks.Count, 0);
cuesheet.AddTrack(new Track(), testHelper.ApplicationOptions);
Assert.AreEqual(cuesheet.Tracks.Count, 1);
Assert.IsTrue(trackAddedFired);
Assert.IsTrue(tracksAddedEvent.WaitOne(1000));
}

[TestMethod()]
Expand Down Expand Up @@ -221,7 +220,7 @@ public void MoveAndDeleteTrackTest()
public async Task ImportTestAsync()
{
// Arrange
var fileContent = new List<String>
var fileContent = new List<string>
{
"CuesheetArtist - CuesheetTitle c:\\tmp\\Testfile.mp3",
"Sample Artist 1 - Sample Title 1 00:05:00",
Expand Down Expand Up @@ -271,7 +270,7 @@ public async Task ImportTestCalculateEndCorrectlyAsync()
// Arrange
var textImportMemoryStream = new MemoryStream(Resources.Textimport_Bug_54);
using var reader = new StreamReader(textImportMemoryStream);
List<String?> lines = [];
List<string?> lines = [];
while (reader.EndOfStream == false)
{
lines.Add(reader.ReadLine());
Expand Down Expand Up @@ -320,11 +319,11 @@ public void RecordTest()
cuesheet = new Cuesheet();
cuesheet.StartRecording();
track = new Track();
testHelper.RecordOptions.RecordTimeSensitivity = Options.TimeSensitivityMode.Seconds;
testHelper.RecordOptions.RecordTimeSensitivity = TimeSensitivityMode.Seconds;
cuesheet.AddTrack(track, testHelper.ApplicationOptions, testHelper.RecordOptions);
Assert.AreEqual(TimeSpan.Zero, track.Begin);
Assert.IsNull(track.End);
System.Threading.Thread.Sleep(3000);
Thread.Sleep(3000);
track2 = new Track();
cuesheet.AddTrack(track2, testHelper.ApplicationOptions, testHelper.RecordOptions);
Assert.IsNotNull(track.End);
Expand Down Expand Up @@ -427,7 +426,9 @@ public void RemoveTrackTest()
{
var testHelper = new TestHelper();
testHelper.ApplicationOptions.LinkTracksWithPreviousOne = true;
AutoResetEvent tracksRemovedEvent = new(false);
var cuesheet = new Cuesheet();
cuesheet.TracksRemoved += (sender, trackAddRemoveEventArgs) => tracksRemovedEvent.Set();
var track1 = new Track() { Artist = "1", Title = "1" };
var track2 = new Track() { Artist = "2", Title = "2" };
var track3 = new Track() { Artist = "3", Title = "3" };
Expand All @@ -445,12 +446,14 @@ public void RemoveTrackTest()
track5.End = new TimeSpan(0, 25, 0);
Assert.AreEqual(5, cuesheet.Tracks.Count);
cuesheet.RemoveTrack(track2);
Assert.AreEqual(true, tracksRemovedEvent.WaitOne(1000));
Assert.AreEqual((uint)2, track3.Position);
Assert.AreEqual((uint)3, track4.Position);
Assert.AreEqual((uint)4, track5.Position);
testHelper = new TestHelper();
testHelper.ApplicationOptions.LinkTracksWithPreviousOne = true;
cuesheet = new Cuesheet();
cuesheet.TracksRemoved += (sender, trackAddRemoveEventArgs) => tracksRemovedEvent.Set();
track1 = new Track
{
Artist = "Track 1",
Expand Down Expand Up @@ -487,6 +490,7 @@ public void RemoveTrackTest()
cuesheet.AddTrack(track5, testHelper.ApplicationOptions);
var list = new List<Track>() { track2, track4 };
cuesheet.RemoveTracks(list.AsReadOnly());
Assert.AreEqual(true, tracksRemovedEvent.WaitOne(1000));
Assert.AreEqual(3, cuesheet.Tracks.Count);
Assert.AreEqual(new TimeSpan(0, 5, 0), track3.Begin);
Assert.AreEqual(new TimeSpan(0, 15, 0), track5.Begin);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
//You should have received a copy of the GNU General Public License
//along with Foobar. If not, see
//<http: //www.gnu.org/licenses />.
using AudioCuesheetEditor.Model.AudioCuesheet;
using AudioCuesheetEditor.Model.Entity;
using AudioCuesheetEditorTests.Utility;
using AudioCuesheetEditor.Tests.Utility;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Linq;

namespace AudioCuesheetEditor.Model.AudioCuesheet.Tests
namespace AudioCuesheetEditor.Tests.Model.AudioCuesheet
{
[TestClass()]
public class TrackTests
Expand Down Expand Up @@ -84,7 +85,7 @@ public void LinkTrackTest()
Position = 2
};
Assert.IsFalse(track2.IsLinkedToPreviousTrack);
Boolean eventFired = false;
bool eventFired = false;
track2.IsLinkedToPreviousTrackChanged += delegate
{
eventFired = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,18 @@
//You should have received a copy of the GNU General Public License
//along with Foobar. If not, see
//<http: //www.gnu.org/licenses />.
using AudioCuesheetEditorTests.Utility;
using AudioCuesheetEditor.Model.Entity;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;

namespace AudioCuesheetEditor.Model.Entity.Tests
namespace AudioCuesheetEditor.Tests.Model.Entity
{
public class ValidateableTestClass : Validateable<ValidateableTestClass>
{
private String? testProperty;
private string? testProperty;
private int? testProperty2;

public String? TestProperty
public string? TestProperty
{
get => testProperty;
set
Expand All @@ -34,7 +33,7 @@ public String? TestProperty
OnValidateablePropertyChanged();
}
}
public int? TestProperty2
public int? TestProperty2
{
get => testProperty2;
set
Expand All @@ -51,9 +50,9 @@ protected override ValidationResult Validate(string property)
{
case nameof(TestProperty):
validationStatus = ValidationStatus.Success;
if (String.IsNullOrEmpty(TestProperty))
if (string.IsNullOrEmpty(TestProperty))
{
validationMessages ??= new();
validationMessages ??= [];
validationMessages.Add(new ValidationMessage("{0} has no value!", nameof(TestProperty)));
}
break;
Expand All @@ -69,7 +68,7 @@ public void ValidateTest()
{
var testObject = new ValidateableTestClass
{
TestProperty = String.Empty
TestProperty = string.Empty
};
Assert.AreEqual(ValidationStatus.Error, testObject.Validate().Status);
Assert.IsNotNull(testObject.Validate().ValidationMessages);
Expand Down
Loading
Loading