Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

method to get( SD_No, FolderName, FileName ) #34

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CameraApi.Core/CameraApi.Core.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.4</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="11.0.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
</ItemGroup>

</Project>
23 changes: 23 additions & 0 deletions CameraApi.Core/CameraMode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
namespace CameraApi.Core
{
using System;
using System.Collections.Generic;
using System.Text;

/// <summary>
/// Camera Mode wheel
/// </summary>
public enum CameraMode
{
iA,
P,
A,
S,
M,
vP,
vA,
vS,
vM,
Unknown
}
}
48 changes: 48 additions & 0 deletions CameraApi.Core/CameraState.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
namespace CameraApi.Core
{
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using JetBrains.Annotations;

public interface ICameraState : INotifyPropertyChanged
{
string Aperture { get; }

string CameraMode { get; }

bool CanCapture { get; }

bool CanChangeAperture { get; }

bool CanChangeShutter { get; }

bool CanManualFocus { get; }

float Focus { get; }

float ExposureShift { get; }

string FocusMode { get; }

bool IsBusy { get; }

string Iso { get; }

bool IsVideoMode { get; }

int MaximumFocus { get; }

RecState RecState { get; }

string Shutter { get; }

int Zoom { get; }

ObservableCollection<IActionItem> Apertures { get; }

ObservableCollection<IActionItem> Shutters { get; }
}
}
11 changes: 11 additions & 0 deletions CameraApi.Core/ChangeDirection.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace CameraApi.Core
{
public enum ChangeDirection
{
WideFast,
WideNormal,
ZoomStop,
TeleFast,
TeleNormal
}
}
2 changes: 1 addition & 1 deletion Core/Camera/FloatPoint.cs → CameraApi.Core/FloatPoint.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GMaster.Core.Camera
namespace CameraApi.Core
{
public struct FloatPoint
{
Expand Down
26 changes: 26 additions & 0 deletions CameraApi.Core/FocusMode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
namespace CameraApi.Core
{
/// <summary>
/// Camera AutoFocus mode
/// </summary>
public enum AutoFocusMode
{
Unknown,
Manual,
Face,
Track,
MultiArea,
FreeMultiArea,
OneArea,
Pinpoint
}

public enum FocusMode
{
MF,
AFC,
AFF,
AFS,
Unknown
}
}
32 changes: 32 additions & 0 deletions CameraApi.Core/GeneralMode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
namespace CameraApi.Core
{
public abstract class GeneralMode
{
/// <summary>
/// Initializes a new instance of the <see cref="GeneralMode"/> class.
/// </summary>
/// <param name="shortdesc">Short Description.</param>
/// <param name="longdesc">Long Description.</param>
public GeneralMode(string shortdesc, string longdesc)
{
ShortDescription = shortdesc;
LongDescription = longdesc;
}

public string ShortDescription { get; }

public string LongDescription { get; }

public override bool Equals(object obj)
{
var mode = obj as GeneralMode;
return mode != null &&
ShortDescription == mode.ShortDescription;
}

public override int GetHashCode()
{
return ShortDescription.GetHashCode();
}
}
}
File renamed without changes.
11 changes: 11 additions & 0 deletions CameraApi.Core/IActionItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace CameraApi.Core
{
using System;
using System.Collections.Generic;
using System.Text;

public interface IActionItem
{
string Text { get; }
}
}
155 changes: 155 additions & 0 deletions CameraApi.Core/ICamera.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
namespace CameraApi.Core
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;

public delegate void LiveviewReceiver(ArraySegment<byte> segment);

public enum UpdateStateFailReason
{
RequestFailed = 0,
LumixException = 1,
NotConnected = 2
}

public interface ILiveviewProvider : ICamera
{
Task StartLiveview(LiveviewReceiver receiver, CancellationToken token);

Task StopLiveview(CancellationToken token);
}

public interface ICameraStateProvider
{
event Action<ICameraState> StateChanged;

event Action<ICamera, UpdateStateFailReason> StateUpdateFailed;

ICameraState State { get; }
}

public interface ICameraUdpConnector
{
void ProcessUdpMessage(byte[] argsData);

Task<bool> Connect(int liveViewPort);
}

public interface ICameraMFAssistController
{
Task MfAssistZoom(PinchStage stop, FloatPoint floatPoint, float f);

Task MfAssistMove(PinchStage stage, FloatPoint fp);
}

public interface ICameraAutofocusController
{
Task FocusPointMove(FloatPoint fp);

Task FocusPointResize(PinchStage stage, FloatPoint point, float extend);
}

public interface ICameraStateController
{
Task CaptureStart();

Task CaptureStop();

Task ChangeFocus(ChangeDirection changeDirection);
}

public interface IEthernetCamera : ICamera
{
string CameraHost { get; }

string Usn { get; }
}

public interface IUdpCamera : IEthernetCamera
{
Task ProcessMessage(byte[] data);
}

public interface ICamera : IDisposable
{
Task Connect(CancellationToken token);

Task Disconnect(CancellationToken token);
}

public interface IFocusAreas
{
IReadOnlyList<IBox> Boxes { get; }
}

public enum PinchStage
{
Start = 0,
Stop = 1,
Continue = 2,
Single = 3
}

public interface IBox
{
float Height { get; }
BoxProps Props { get; }
float Width { get; }
float X1 { get; }
float X2 { get; }
float Y1 { get; }
float Y2 { get; }

int GetHashCode();
}

public struct BoxProps
{
public bool Failed { get; internal set; }

public FocusAreaType Type { get; internal set; }

public bool Equals(BoxProps other)
{
return Failed == other.Failed && Type == other.Type;
}

public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj))
{
return false;
}

return obj is BoxProps && Equals((BoxProps)obj);
}

public override int GetHashCode()
{
unchecked
{
return (Failed.GetHashCode() * 397) ^ (int)Type;
}
}
}

public enum FocusAreaType
{
OneAreaSelected = 0x0001,
FaceOther = 0xff01,
MainFace = 0x0002,
Eye = 0xff09,
TrackUnlock = 0xff03,
TrackLock = 0x0003,
MfAssistSelection = 0x0005,
MfAssistPinP = 0x0006,
MfAssistFullscreen = 0x0007,
MfAssistLimit = 0x0008,
Box = 0xff02,
Cross = 0xff04
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GMaster.Core.Camera.LumixData
namespace CameraApi.Core
{
public enum RecState
{
Expand Down
12 changes: 12 additions & 0 deletions CameraApi.Panasonic/CameraApi.Panasonic.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.4</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\CameraApi.Core\CameraApi.Core.csproj" />
<ProjectReference Include="..\Core\Core.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GMaster.Core.Camera
namespace CameraApi.Panasonic
{
public class CameraMenuItem256 : ICameraMenuItem
{
Expand Down
Loading