1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-16 23:51:18 +02:00

Fix Loudness effect unit tests

Introduce new helper functions which handle selection and update
scripted selection to new upstream.
This commit is contained in:
Max Maisel
2019-04-11 17:25:38 +02:00
parent f911bdb46c
commit 5f0c02273e
2 changed files with 35 additions and 24 deletions

View File

@@ -62,6 +62,18 @@ function aud_do(command)
until strncmp(string, "BatchCommand finished:", length("BatchCommand finished:"));
end
## Selection helper functions
function remove_all_tracks()
aud_do("SelectTracks: Track=0 TrackCount=100 Mode=Set\n");
aud_do("RemoveTracks:\n");
end
function select_tracks(num, count)
aud_do("Select: Start=0 Mode=Set\n");
aud_do("SelCursorToTrackEnd:\n");
aud_do(sprintf("SelectTracks: Track=%d TrackCount=%d Mode=Set\n", num, count));
end
## Float equal comparison helper
function [ret] = float_eq(x, y, eps=0.001)
ret = abs(x - y) < eps;