-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
93 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
import uiautomation as auto | ||
import win32api | ||
import win32con | ||
|
||
|
||
def move_wheel(distance: int): | ||
win32api.mouse_event(win32con.MOUSEEVENTF_WHEEL, 0, 0, distance) | ||
|
||
|
||
def scroll_inside(target: auto.Control, bound: auto.Control): | ||
while True: | ||
if target.BoundingRectangle.top < bound.BoundingRectangle.top: | ||
bound.MoveCursorToMyCenter(simulateMove=False) | ||
move_wheel(bound.BoundingRectangle.top - target.BoundingRectangle.top) | ||
elif target.BoundingRectangle.bottom > bound.BoundingRectangle.bottom: | ||
bound.MoveCursorToMyCenter(simulateMove=False) | ||
move_wheel(bound.BoundingRectangle.bottom - target.BoundingRectangle.bottom) | ||
else: | ||
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import sys | ||
|
||
sys.path.append('core') | ||
|
||
from core import engine, projects, tracks | ||
|
||
if __name__ == '__main__': | ||
path = r'..\demo\separate_tracks\assets\示例.svip' | ||
prefix = '示例' | ||
engine.start_xstudio(engine=r'E:\YQ数据空间\YQ实验室\实验室:XStudioSinger\内测\XStudioSinger_2.0.0_beta2.exe', project=path) | ||
for track in tracks.enum_tracks(): | ||
track.set_solo(True) | ||
projects.export_project(title=f'{prefix}_轨道{track.index}') | ||
engine.quit_xstudio() |