mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 12:26:30 +00:00
add publish script, check its work
This commit is contained in:
@@ -123,7 +123,7 @@ public class AnnotatorEventHandler(
|
||||
switch (controlEnum)
|
||||
{
|
||||
case PlaybackControlEnum.Play:
|
||||
Play();
|
||||
await Play(cancellationToken);
|
||||
break;
|
||||
case PlaybackControlEnum.Pause:
|
||||
mediaPlayer.Pause();
|
||||
@@ -170,10 +170,10 @@ public class AnnotatorEventHandler(
|
||||
mediaPlayer.Volume = 0;
|
||||
break;
|
||||
case PlaybackControlEnum.Previous:
|
||||
NextMedia(isPrevious: true);
|
||||
await NextMedia(isPrevious: true, ct: cancellationToken);
|
||||
break;
|
||||
case PlaybackControlEnum.Next:
|
||||
NextMedia();
|
||||
await NextMedia(ct: cancellationToken);
|
||||
break;
|
||||
case PlaybackControlEnum.None:
|
||||
break;
|
||||
@@ -188,7 +188,7 @@ public class AnnotatorEventHandler(
|
||||
}
|
||||
}
|
||||
|
||||
private void NextMedia(bool isPrevious = false)
|
||||
private async Task NextMedia(bool isPrevious = false, CancellationToken ct = default)
|
||||
{
|
||||
var increment = isPrevious ? -1 : 1;
|
||||
var check = isPrevious ? -1 : mainWindow.LvFiles.Items.Count;
|
||||
@@ -196,7 +196,7 @@ public class AnnotatorEventHandler(
|
||||
return;
|
||||
|
||||
mainWindow.LvFiles.SelectedIndex += increment;
|
||||
Play();
|
||||
await Play(ct);
|
||||
}
|
||||
|
||||
public async Task Handle(VolumeChangedEvent notification, CancellationToken cancellationToken)
|
||||
@@ -211,7 +211,7 @@ public class AnnotatorEventHandler(
|
||||
mediaPlayer.Volume = volume;
|
||||
}
|
||||
|
||||
private void Play()
|
||||
private async Task Play(CancellationToken ct = default)
|
||||
{
|
||||
if (mainWindow.LvFiles.SelectedItem == null)
|
||||
return;
|
||||
@@ -219,6 +219,8 @@ public class AnnotatorEventHandler(
|
||||
mainWindow.Editor.ResetBackground();
|
||||
|
||||
formState.CurrentMedia = mediaInfo;
|
||||
//need to wait a bit for correct VLC playback event handling
|
||||
await Task.Delay(100, ct);
|
||||
mediaPlayer.Stop();
|
||||
mainWindow.Title = $"Azaion Annotator - {mediaInfo.Name}";
|
||||
mainWindow.BlinkHelp(HelpTexts.HelpTextsDict[HelpTextEnum.PauseForAnnotations]);
|
||||
@@ -269,7 +271,7 @@ public class AnnotatorEventHandler(
|
||||
else
|
||||
{
|
||||
File.Copy(formState.CurrentMedia.Path, imgPath, overwrite: true);
|
||||
NextMedia();
|
||||
await NextMedia(ct: cancellationToken);
|
||||
}
|
||||
var annotation = await annotationService.SaveAnnotation(formState.VideoName, time, imageExtension, currentDetections, SourceEnum.Manual, token: cancellationToken);
|
||||
mainWindow.AddAnnotation(annotation);
|
||||
|
||||
Reference in New Issue
Block a user