Skip to content

Commit

Permalink
Focus distance
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeltris committed Apr 14, 2019
1 parent d74e06d commit 4361b3e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion SonyAlphaUSB/Ids.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public enum SettingIds
FocusMagnifierMoveLeftRequest = 0xD2CF,//CF D2
FocusMagnifierMoveRightRequest = 0xD2D0,//D0 D2

_UnkD2D1 = 0xD2D1,//D1 D2
FocusDistance = 0xD2D1,//D1 D2

/// <summary>
/// Used to toggle AF/MF (1=MF, 2=AF).
Expand Down
4 changes: 4 additions & 0 deletions SonyAlphaUSB/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ static void Main(string[] args)
{
cameras.Remove(camera);
}
else
{
camera.ModifyFocusDistance(7);
}
}

Stopwatch stopwatch = new Stopwatch();
Expand Down
10 changes: 10 additions & 0 deletions SonyAlphaUSB/SonyCamera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,16 @@ public void SetFocusMode(FocusModeToggle focusMode)
DoMainSettingI16(SettingIds.FocusModeToggleRequest, (short)focusMode);
}

/// <summary>
/// Maximum value is 7/-7
/// </summary>
/// <param name="steps"></param>
public void ModifyFocusDistance(int steps)
{
// TODO: If the steps value is larger than 7 then use a loop?
DoMainSettingI16(SettingIds.FocusDistance, (short)steps);
}

public ShootingMode GetShootingMode()
{
CameraSetting setting = GetSetting(SettingIds.ShootingMode);
Expand Down

0 comments on commit 4361b3e

Please sign in to comment.