mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 22:46:30 +00:00
add image editing
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
@@ -28,6 +27,9 @@ public class Config
|
||||
public double RightPanelWidth { get; set; }
|
||||
|
||||
public bool ShowHelpOnStart { get; set; }
|
||||
|
||||
public List<string> VideoFormats { get; set; }
|
||||
public List<string> ImageFormats { get; set; }
|
||||
}
|
||||
|
||||
public interface IConfigRepository
|
||||
@@ -49,6 +51,9 @@ public class FileConfigRepository(ILogger<FileConfigRepository> logger) : IConfi
|
||||
private static readonly Size DefaultWindowSize = new(1280, 720);
|
||||
private static readonly Point DefaultWindowLocation = new(100, 100);
|
||||
|
||||
private static readonly List<string> DefaultVideoFormats = ["mp4", "mov", "avi"];
|
||||
private static readonly List<string> DefaultImageFormats = ["jpg", "jpeg", "png", "bmp"];
|
||||
|
||||
public Config Get()
|
||||
{
|
||||
var exePath = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory)!;
|
||||
@@ -65,7 +70,10 @@ public class FileConfigRepository(ILogger<FileConfigRepository> logger) : IConfi
|
||||
|
||||
WindowLocation = DefaultWindowLocation,
|
||||
WindowSize = DefaultWindowSize,
|
||||
ShowHelpOnStart = true
|
||||
ShowHelpOnStart = true,
|
||||
|
||||
VideoFormats = DefaultVideoFormats,
|
||||
ImageFormats = DefaultImageFormats
|
||||
};
|
||||
}
|
||||
var str = File.ReadAllText(CONFIG_PATH);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
|
||||
@@ -8,14 +7,16 @@ namespace Azaion.Annotator.DTO;
|
||||
public class FormState
|
||||
{
|
||||
public SelectionState SelectionState { get; set; } = SelectionState.None;
|
||||
|
||||
public string CurrentFile { get; set; } = null!;
|
||||
|
||||
public MediaFileInfo? CurrentMedia { get; set; }
|
||||
public Size CurrentVideoSize { get; set; }
|
||||
public string VideoName => Path.GetFileNameWithoutExtension(CurrentFile).Replace(" ", "");
|
||||
public string VideoName => string.IsNullOrEmpty(CurrentMedia?.Name)
|
||||
? ""
|
||||
: Path.GetFileNameWithoutExtension(CurrentMedia.Name).Replace(" ", "");
|
||||
public TimeSpan CurrentVideoLength { get; set; }
|
||||
public int CurrentVolume { get; set; } = 100;
|
||||
public ObservableCollection<AnnotationResult> AnnotationResults { get; set; } = [];
|
||||
|
||||
|
||||
public string GetTimeName(TimeSpan ts) => $"{VideoName}_{ts:hmmssf}";
|
||||
|
||||
public TimeSpan? GetTime(string name)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace Azaion.Annotator.DTO;
|
||||
|
||||
public class MediaFileInfo
|
||||
{
|
||||
public string Name { get; set; } = null!;
|
||||
public string Path { get; set; } = null!;
|
||||
public TimeSpan Duration { get; set; }
|
||||
public string DurationStr => $"{Duration:h\\:mm\\:ss}";
|
||||
public bool HasAnnotations { get; set; }
|
||||
public MediaTypes MediaType { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Azaion.Annotator.DTO;
|
||||
|
||||
public enum MediaTypes
|
||||
{
|
||||
None = 0,
|
||||
Video = 1,
|
||||
Image = 2
|
||||
}
|
||||
@@ -12,5 +12,7 @@ public enum PlaybackControlEnum
|
||||
RemoveSelectedAnns = 7,
|
||||
RemoveAllAnns = 8,
|
||||
TurnOffVolume = 9,
|
||||
TurnOnVolume = 10
|
||||
TurnOnVolume = 10,
|
||||
Previous = 11,
|
||||
Next = 12
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
namespace Azaion.Annotator.DTO;
|
||||
|
||||
public class VideoFileInfo
|
||||
{
|
||||
public string Name { get; set; } = null!;
|
||||
public string Path { get; set; } = null!;
|
||||
public TimeSpan Duration { get; set; }
|
||||
public string DurationStr => $"{Duration:h\\:mm\\:ss}";
|
||||
public bool HasAnnotations { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user