mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 09:06:30 +00:00
add manual Tile Processor
zoom on video on pause (temp image)
This commit is contained in:
@@ -56,6 +56,7 @@ public partial class Annotator
|
||||
public Dictionary<string, MediaFileInfo> MediaFilesDict = new();
|
||||
|
||||
public IntervalTree<TimeSpan, Annotation> TimedAnnotations { get; set; } = new();
|
||||
public string MainTitle { get; set; }
|
||||
|
||||
public Annotator(
|
||||
IConfigUpdater configUpdater,
|
||||
@@ -72,7 +73,9 @@ public partial class Annotator
|
||||
IGpsMatcherService gpsMatcherService)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
||||
MainTitle = $"Azaion Annotator {Constants.GetLocalVersion()}";
|
||||
Title = MainTitle;
|
||||
_appConfig = appConfig.Value;
|
||||
_configUpdater = configUpdater;
|
||||
_libVLC = libVLC;
|
||||
@@ -194,7 +197,7 @@ public partial class Annotator
|
||||
_formState.CurrentMrl = _mediaPlayer.Media?.Mrl ?? "";
|
||||
uint vw = 0, vh = 0;
|
||||
_mediaPlayer.Size(0, ref vw, ref vh);
|
||||
_formState.CurrentVideoSize = new Size(vw, vh);
|
||||
_formState.CurrentMediaSize = new Size(vw, vh);
|
||||
_formState.CurrentVideoLength = TimeSpan.FromMilliseconds(_mediaPlayer.Length);
|
||||
};
|
||||
|
||||
@@ -289,27 +292,23 @@ public partial class Annotator
|
||||
StatusClock.Text = $"{TimeSpan.FromMilliseconds(_mediaPlayer.Time):mm\\:ss} / {_formState.CurrentVideoLength:mm\\:ss}";
|
||||
Editor.ClearExpiredAnnotations(time);
|
||||
});
|
||||
|
||||
ShowAnnotation(TimedAnnotations.Query(time).FirstOrDefault(), showImage);
|
||||
var annotation = TimedAnnotations.Query(time).FirstOrDefault();
|
||||
if (annotation != null) ShowAnnotation(annotation, showImage);
|
||||
}
|
||||
|
||||
private void ShowAnnotation(Annotation? annotation, bool showImage = false)
|
||||
private void ShowAnnotation(Annotation annotation, bool showImage = false)
|
||||
{
|
||||
if (annotation == null)
|
||||
return;
|
||||
Dispatcher.Invoke(async () =>
|
||||
{
|
||||
var videoSize = _formState.CurrentVideoSize;
|
||||
if (showImage)
|
||||
{
|
||||
if (File.Exists(annotation.ImagePath))
|
||||
{
|
||||
Editor.SetBackground(await annotation.ImagePath.OpenImage());
|
||||
_formState.BackgroundTime = annotation.Time;
|
||||
videoSize = Editor.RenderSize;
|
||||
}
|
||||
}
|
||||
Editor.CreateDetections(annotation.Time, annotation.Detections, _appConfig.AnnotationConfig.DetectionClasses, videoSize);
|
||||
Editor.CreateDetections(annotation.Time, annotation.Detections, _appConfig.AnnotationConfig.DetectionClasses, _formState.CurrentMediaSize);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -321,7 +320,7 @@ public partial class Annotator
|
||||
|
||||
var annotations = await _dbFactory.Run(async db =>
|
||||
await db.Annotations.LoadWith(x => x.Detections)
|
||||
.Where(x => x.OriginalMediaName == _formState.VideoName)
|
||||
.Where(x => x.OriginalMediaName == _formState.MediaName)
|
||||
.OrderBy(x => x.Time)
|
||||
.ToListAsync(token: MainCancellationSource.Token));
|
||||
|
||||
@@ -583,13 +582,11 @@ public partial class Annotator
|
||||
private void SoundDetections(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MessageBox.Show("Функція Аудіоаналіз знаходиться в стадії розробки","Система", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
_logger.LogInformation("Denys wishes #1. To be implemented");
|
||||
}
|
||||
|
||||
private void RunDroneMaintenance(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MessageBox.Show("Функція Аналіз стану БПЛА знаходиться в стадії розробки","Система", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
_logger.LogInformation("Denys wishes #2. To be implemented");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user