1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-07 08:34:06 +02:00

Fix source code indentation problems

This commit is contained in:
chylex 2021-12-17 00:58:38 +01:00
parent d9782f554f
commit b18cd2658c
Signed by: chylex
GPG Key ID: 4DE42C8F19A80548
3 changed files with 43 additions and 42 deletions
Browser/Notification/Screenshot
Management

View File

@ -24,10 +24,10 @@ sealed class TweetScreenshotManager : IDisposable {
private readonly Timer disposer;
#if GEN_SCREENSHOT_FRAMES
private readonly Timer debugger;
private int frameCounter;
private readonly Timer debugger;
private int frameCounter;
public const int WaitFrames = 60;
public const int WaitFrames = 60;
#else
public const int WaitFrames = 5;
#endif
@ -45,8 +45,8 @@ public TweetScreenshotManager(FormBrowser owner, PluginManager pluginManager) {
this.disposer.Tick += disposer_Tick;
#if GEN_SCREENSHOT_FRAMES
this.debugger = new Timer{ Interval = 16 };
this.debugger.Tick += debugger_Tick;
this.debugger = new Timer{ Interval = 16 };
this.debugger.Tick += debugger_Tick;
#endif
}
@ -71,7 +71,7 @@ public void Trigger(string html, int width) {
timeout.Start();
#if GEN_SCREENSHOT_FRAMES
StartDebugger();
StartDebugger();
#endif
#if !NO_HIDE_SCREENSHOTS
@ -90,14 +90,14 @@ private void Callback() {
#if !NO_HIDE_SCREENSHOTS
OnFinished();
#else
screenshot.MoveToVisibleLocation();
screenshot.FormClosed += (sender, args) => disposer.Start();
screenshot.MoveToVisibleLocation();
screenshot.FormClosed += (sender, args) => disposer.Start();
#endif
}
private void OnFinished() {
#if GEN_SCREENSHOT_FRAMES
debugger.Stop();
debugger.Stop();
#endif
screenshot.Location = ControlExtensions.InvisibleLocation;
@ -107,7 +107,7 @@ private void OnFinished() {
public void Dispose() {
#if GEN_SCREENSHOT_FRAMES
debugger.Dispose();
debugger.Dispose();
#endif
timeout.Dispose();
@ -116,32 +116,32 @@ public void Dispose() {
}
#if GEN_SCREENSHOT_FRAMES
private static readonly string DebugScreenshotPath = Path.Combine(Program.StoragePath, "TD_Screenshots");
private static readonly string DebugScreenshotPath = Path.Combine(Program.StoragePath, "TD_Screenshots");
private void StartDebugger(){
frameCounter = 0;
private void StartDebugger(){
frameCounter = 0;
try{
Directory.Delete(DebugScreenshotPath, true);
WindowsUtils.TrySleepUntil(() => !Directory.Exists(DebugScreenshotPath), 1000, 10);
}catch(DirectoryNotFoundException){}
Directory.CreateDirectory(DebugScreenshotPath);
debugger.Start();
}
try{
Directory.Delete(DebugScreenshotPath, true);
WindowsUtils.TrySleepUntil(() => !Directory.Exists(DebugScreenshotPath), 1000, 10);
}catch(DirectoryNotFoundException){}
private void debugger_Tick(object sender, EventArgs e){
if (frameCounter < 63 && screenshot.TakeScreenshot(true)){
try{
Clipboard.GetImage()?.Save(Path.Combine(DebugScreenshotPath, "frame_" + (++frameCounter) + ".png"), ImageFormat.Png);
}catch{
System.Diagnostics.Debug.WriteLine("Failed generating frame " + frameCounter);
}
}
else{
debugger.Stop();
}
}
Directory.CreateDirectory(DebugScreenshotPath);
debugger.Start();
}
private void debugger_Tick(object sender, EventArgs e){
if (frameCounter < 63 && screenshot.TakeScreenshot(true)){
try{
Clipboard.GetImage()?.Save(Path.Combine(DebugScreenshotPath, "frame_" + (++frameCounter) + ".png"), ImageFormat.Png);
}catch{
System.Diagnostics.Debug.WriteLine("Failed generating frame " + frameCounter);
}
}
else{
debugger.Stop();
}
}
#endif
}
}

View File

@ -19,7 +19,7 @@ sealed class AnalyticsManager : IDisposable {
private static readonly Uri CollectionUrl = new Uri(
#if (DEBUG && ANALYTICS_LOCALHOST)
"http://localhost/newhome/tweetduck/~breadcrumb/request.php?type=report"
"http://localhost/newhome/tweetduck/~breadcrumb/request.php?type=report"
#else
"https://tweetduck.chylex.com/breadcrumb/report"
#endif
@ -52,7 +52,7 @@ public AnalyticsManager(FormBrowser browser, PluginManager plugins, string file)
}
#if (DEBUG && ANALYTICS_INSTANT)
SendReport();
SendReport();
#endif
}

View File

@ -37,14 +37,15 @@ public void Launch(string videoUrl, string tweetUrl, string username) {
DuplexPipe.Server pipe = DuplexPipe.CreateServer();
pipe.DataIn += pipe_DataIn;
Process process;
ProcessStartInfo startInfo = new ProcessStartInfo {
FileName = Path.Combine(Program.ProgramPath, "TweetDuck.Video.exe"),
Arguments = $"{owner.Handle} {(int) Math.Floor(100F * owner.GetDPIScale())} {Config.VideoPlayerVolume} \"{videoUrl}\" \"{pipe.GenerateToken()}\"",
UseShellExecute = false,
RedirectStandardOutput = true
};
if ((process = Process.Start(new ProcessStartInfo {
FileName = Path.Combine(Program.ProgramPath, "TweetDuck.Video.exe"),
Arguments = $"{owner.Handle} {(int) Math.Floor(100F * owner.GetDPIScale())} {Config.VideoPlayerVolume} \"{videoUrl}\" \"{pipe.GenerateToken()}\"",
UseShellExecute = false,
RedirectStandardOutput = true
})) != null) {
Process process;
if ((process = Process.Start(startInfo)) != null) {
currentInstance = new Instance(process, pipe, videoUrl, tweetUrl, username);
process.EnableRaisingEvents = true;