Initial scaffold: ytLive C# WPF project
- MVVM architecture (Models, ViewModels, Views, Services, Helpers) - Models: Scene, Source, StreamConfig, StreamHealth, YouTubeChannel, ChatMessage - Services: YouTubeAuthService (OAuth2), YouTubeStreamService (broadcasts/stream health), YouTubeChatService (live chat polling) - ViewModels: MainViewModel with scene management, stream controls, chat - MainWindow with dark theme: scene/source panel, preview area, chat panel, status bar - Version roadmap: v0.1 (scenes, RTMP, OAuth2, chat, health) -> 1.0
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
namespace ytLive.Models;
|
||||
|
||||
public class Scene
|
||||
{
|
||||
public string Id { get; init; } = Guid.NewGuid().ToString();
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public List<Source> Sources { get; set; } = new();
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
namespace ytLive.Models;
|
||||
|
||||
public enum SourceType
|
||||
{
|
||||
DisplayCapture,
|
||||
WindowCapture,
|
||||
Webcam,
|
||||
Image,
|
||||
TextOverlay
|
||||
}
|
||||
|
||||
public class Source
|
||||
{
|
||||
public string Id { get; init; } = Guid.NewGuid().ToString();
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public SourceType Type { get; set; }
|
||||
public bool IsEnabled { get; set; } = true;
|
||||
|
||||
// Display/Window capture
|
||||
public int? MonitorIndex { get; set; }
|
||||
public IntPtr? WindowHandle { get; set; }
|
||||
|
||||
// Webcam
|
||||
public string? DeviceId { get; set; }
|
||||
|
||||
// Image
|
||||
public string? FilePath { get; set; }
|
||||
|
||||
// Position/transform
|
||||
public double X { get; set; }
|
||||
public double Y { get; set; }
|
||||
public double Width { get; set; }
|
||||
public double Height { get; set; }
|
||||
public double Opacity { get; set; } = 1.0;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
namespace ytLive.Models;
|
||||
|
||||
public enum StreamStatus
|
||||
{
|
||||
Offline,
|
||||
Connecting,
|
||||
Streaming,
|
||||
Error
|
||||
}
|
||||
|
||||
public class StreamConfig
|
||||
{
|
||||
public string Title { get; set; } = string.Empty;
|
||||
public string Description { get; set; } = string.Empty;
|
||||
public string StreamKey { get; set; } = string.Empty;
|
||||
public string IngestUrl { get; set; } = "rtmp://a.rtmp.youtube.com/live2";
|
||||
public bool IsLowLatency { get; set; } = true;
|
||||
public int TargetBitrate { get; set; } = 6000;
|
||||
public int TargetFps { get; set; } = 60;
|
||||
public string Resolution { get; set; } = "1920x1080";
|
||||
}
|
||||
|
||||
public class StreamHealth
|
||||
{
|
||||
public StreamStatus Status { get; set; }
|
||||
public double CurrentBitrate { get; set; }
|
||||
public int DroppedFrames { get; set; }
|
||||
public double FPS { get; set; }
|
||||
public TimeSpan StreamDuration { get; set; }
|
||||
public string? LastError { get; set; }
|
||||
|
||||
// YouTube-specific
|
||||
public string? HealthStatus { get; set; } // "good", "bad", "ok"
|
||||
public string? HealthMessage { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
namespace ytLive.Models;
|
||||
|
||||
public class YouTubeChannel
|
||||
{
|
||||
public string ChannelId { get; set; } = string.Empty;
|
||||
public string DisplayName { get; set; } = string.Empty;
|
||||
public string ProfileImageUrl { get; set; } = string.Empty;
|
||||
public string AccessToken { get; set; } = string.Empty;
|
||||
public string RefreshToken { get; set; } = string.Empty;
|
||||
public DateTime TokenExpiry { get; set; }
|
||||
}
|
||||
|
||||
public class ChatMessage
|
||||
{
|
||||
public string Id { get; init; } = Guid.NewGuid().ToString();
|
||||
public string AuthorName { get; set; } = string.Empty;
|
||||
public string AuthorChannelId { get; set; } = string.Empty;
|
||||
public string AuthorImageUrl { get; set; } = string.Empty;
|
||||
public string Message { get; set; } = string.Empty;
|
||||
public DateTime Timestamp { get; set; }
|
||||
public bool IsSuperChat { get; set; }
|
||||
public double SuperChatAmount { get; set; }
|
||||
public string? SuperChatCurrency { get; set; }
|
||||
public bool IsMember { get; set; }
|
||||
public string? MembershipLevel { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user