Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
license, readme, renamed shit, more asyncs
Browse files Browse the repository at this point in the history
  • Loading branch information
kasthack committed Feb 26, 2017
1 parent d69c6b1 commit 9b85bf8
Show file tree
Hide file tree
Showing 20 changed files with 175 additions and 130 deletions.
28 changes: 28 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
![Screenshot](https://pp.vk.me/c617620/v617620040/169aa/yKiVE7b08IA.jpg)
Timelapser

[![Build status](https://img.shields.io/appveyor/ci/kasthack/timelapser.svg)](https://ci.appveyor.com/project/kasthack/timelapser)
[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/timelapser)
[![license](https://img.shields.io/github/license/kasthack/timelapser.svg)](LICENSE)

![Screenshot](img/screenshot.png)
Binary file added img/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions source/TimeLapser.sln
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
# Visual Studio 15
VisualStudioVersion = 15.0.26206.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TimeLapser", "TimeLapser\TimeLapser.csproj", "{2A508A4D-F0AC-484B-8C27-66E14102AA08}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "kasthack.TimeLapser", "TimeLapser\kasthack.TimeLapser.csproj", "{2A508A4D-F0AC-484B-8C27-66E14102AA08}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
2 changes: 1 addition & 1 deletion source/TimeLapser/Program.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Windows.Forms;

namespace TimeLapser
namespace kasthack.TimeLapser
{
static class Program
{
Expand Down
6 changes: 3 additions & 3 deletions source/TimeLapser/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("TimeLapser")]
[assembly: AssemblyTitle("kasthack.TimeLapser")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TimeLapser")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyProduct("kasthack.TimeLapser")]
[assembly: AssemblyCopyright("Copyright © kasthack 2014-2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down
4 changes: 2 additions & 2 deletions source/TimeLapser/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion source/TimeLapser/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion source/TimeLapser/Recording/DX/DXExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using SharpDX.Direct3D11;
using MapFlags = SharpDX.Direct3D11.MapFlags;

namespace TimeLapser {
namespace kasthack.TimeLapser {
internal static class DXExtensions {
public static int Height(this RawRectangle rect) => rect.Bottom - rect.Top;
public static int Width(this RawRectangle rect) => rect.Right - rect.Left;
Expand Down
6 changes: 3 additions & 3 deletions source/TimeLapser/Recording/DX/DXSnapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Collections.Generic;
using System.Diagnostics;

namespace TimeLapser {
namespace kasthack.TimeLapser {
internal partial class DXSnapper : DisposableBase, ISnapper {
public const int renderPoolSize = 3;
private const int destPixelSize = 3;
Expand Down Expand Up @@ -43,7 +43,7 @@ private Tuple<int, int>[] GetCapturedOutputs() {
ret.Add(new Tuple<int,int>(adapterIndex, outputIndex));
return ret.ToArray();
}
public Bitmap Snap(int timeout = 0) {
public async Task<Bitmap> Snap(int timeout = 0) {
ThrowIfDisposed();
if (_sourceRect == null)
throw new InvalidOperationException("You have to specify source");
Expand All @@ -54,7 +54,7 @@ public Bitmap Snap(int timeout = 0) {
var boundsRect = new Rectangle(0, 0, renderBitmap.Width, renderBitmap.Height);
bitmap = renderBitmap.LockBits(boundsRect, ImageLockMode.WriteOnly, renderBitmap.PixelFormat);

Task.WaitAll(_inputs.Select(input=>Task.Run(()=>input.Snap(bitmap, timeout))).ToArray());
await Task.WhenAll(_inputs.Select(input=>Task.Run(()=>input.Snap(bitmap, timeout)))).ConfigureAwait(false);
}
finally {
// Release source and dest locks
Expand Down
2 changes: 1 addition & 1 deletion source/TimeLapser/Recording/DX/DXSnapperInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using SharpDX.Direct3D11;
using System.Drawing.Imaging;

namespace TimeLapser {
namespace kasthack.TimeLapser {
internal partial class DXSnapper {
private class DXSnapperInput : DisposableBase, IDisposable {
private readonly int _destXOffset;
Expand Down
2 changes: 1 addition & 1 deletion source/TimeLapser/Recording/DisposableBase.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace TimeLapser {
namespace kasthack.TimeLapser {
public abstract class DisposableBase : IDisposable {
private bool _disposed = false;
protected bool ThrowIfDisposed() {
Expand Down
5 changes: 3 additions & 2 deletions source/TimeLapser/Recording/ISnapper.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
using System;
using System.Drawing;
using System.Threading.Tasks;

namespace TimeLapser {
namespace kasthack.TimeLapser {
interface ISnapper : IDisposable
{
void SetSource(Rectangle sourceRect);
/*
* _reusable_ bitmap
* implementation must dispose it
*/
Bitmap Snap(int timeout = 0);
Task<Bitmap> Snap(int timeout = 0);
int MaxProcessingThreads { get; }
}
}
2 changes: 1 addition & 1 deletion source/TimeLapser/Recording/RecordSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Drawing;
using Accord.Video.FFMPEG;

namespace TimeLapser {
namespace kasthack.TimeLapser {

public class RecordSettings {
public RecordSettings(){}
Expand Down
Loading

0 comments on commit 9b85bf8

Please sign in to comment.