forked from nscript-site/NScript.AndroidBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBotOptions.cs
More file actions
112 lines (107 loc) · 3.42 KB
/
BotOptions.cs
File metadata and controls
112 lines (107 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NScript.AndroidBot
{
public enum LockVideoOrientation
{
UNLOCKED = -1,
// lock the current orientation when scrcpy starts
INITIAL = -2,
LockVideoOrientation_0 = 0,
LockVideoOrientation_1,
LockVideoOrientation_2,
LockVideoOrientation_3,
};
public enum LogLevel
{
VERBOSE,
DEBUG,
INFO,
WARN,
ERROR,
};
public class ServerParams
{
public String serial;
public LogLevel log_level;
public String crop;
public String codec_options;
public String encoder_name;
public UInt16 port_start = 29187;
public UInt16 audio_port_start = 28200;
public UInt16 max_size;
public UInt32 bit_rate = 8000000;
public UInt16 max_fps;
public Byte lock_video_orientation;
public bool control;
public UInt32 display_id;
public bool show_touches;
public bool stay_awake;
public bool power_off_on_close;
public bool Display;
}
public class BotOptions
{
public String Serial;
public String Crop;
public String RecordFilename;
public String WindowTitle;
public String PushTarget;
public String RenderDriver;
public String CodecOptions;
public String EncoderName;
public String V4l2Device;
public LogLevel LogLevel;
//enum sc_record_format record_format;
//struct sc_shortcut_mods shortcut_mods;
public UInt16 MaxSize = 1024;
public UInt32 BitRate = 8000000;
public UInt16 MaxFps = 15;
public LockVideoOrientation LockVideoOrientation;
public byte Rotation;
public Int16 WindowX; // SC_WINDOW_POSITION_UNDEFINED for "auto"
public Int16 WindowY; // SC_WINDOW_POSITION_UNDEFINED for "auto"
public UInt16 WindowWidth;
public UInt16 WindowHeight;
public UInt32 DisplayId;
public bool ShowTouches;
public bool FullScreen;
public bool AlwaysOnTop;
public bool Control = true;
public bool Display = true;
public bool TurnScreenOff;
public bool PreferText;
public bool WindowBorderless;
public bool Mipmaps;
public bool StayAwake;
public bool ForceAdbForward = true;
public bool DisableScreensaver;
public bool ForwardKeyRepeat;
public bool ForwardAllClicks;
public bool LegacyPaste;
public bool PowerOffOnClose;
public ServerParams ToServerParams()
{
ServerParams sp = new ServerParams();
sp.serial = this.Serial;
sp.log_level = this.LogLevel;
sp.crop = this.Crop;
sp.max_size = this.MaxSize;
sp.bit_rate = this.BitRate;
sp.max_fps = this.MaxFps;
sp.lock_video_orientation = (byte)this.LockVideoOrientation;
sp.control = this.Control;
sp.display_id = this.DisplayId;
sp.Display = this.Display;
sp.show_touches = this.ShowTouches;
sp.stay_awake = this.StayAwake;
sp.codec_options = this.CodecOptions;
sp.encoder_name = this.EncoderName;
sp.power_off_on_close = this.PowerOffOnClose;
return sp;
}
};
}