diff --git a/ReaScript.cpp b/ReaScript.cpp index 8df79cf6..7f18dc5c 100644 --- a/ReaScript.cpp +++ b/ReaScript.cpp @@ -384,6 +384,7 @@ Mode values: * 1 = compatibility decomposition Warning: this function is no-op on Windows XP (the input string is returned as-is).)", }, + { APIFUNC(CF_SetTcpScroll), "void", "MediaTrack*,int", "track,extraPixels", "Scroll the TCP to the specified track (if non-null) + extraPixels.", }, { APIFUNC(CF_CreatePreview), "CF_Preview*", "PCM_source*", "source", R"(Create a new preview object. Does not take ownership of the source (don't forget to destroy it unless it came from a take!). See CF_Preview_Play and the others CF_Preview_* functions. diff --git a/Zoom.h b/Zoom.h index 9ccbc46f..65873dd8 100644 --- a/Zoom.h +++ b/Zoom.h @@ -32,3 +32,4 @@ void ZoomSlice(); int ZoomInit(bool hookREAPERWndProcs); void ZoomExit(); void ZoomToSelItems(COMMAND_T* = NULL); +void SetVertPos(HWND, int iTrack, bool trackIsPixels, int extraPixels); diff --git a/cfillion/cfillion.cpp b/cfillion/cfillion.cpp index 0ef15554..d97cd10e 100644 --- a/cfillion/cfillion.cpp +++ b/cfillion/cfillion.cpp @@ -36,6 +36,7 @@ #include "SnM/SnM_FX.h" #include "SnM/SnM_Window.h" #include "version.h" +#include "Zoom.h" #include #include @@ -582,6 +583,12 @@ BOOL CF_GetScrollInfo(HWND hwnd, const int bar, LPSCROLLINFO si) return rv; } +void CF_SetTcpScroll(MediaTrack *track, const int extraPixels) +{ + const int iTrack { track ? CSurf_TrackToID(track, false) : extraPixels }; + SetVertPos(GetTrackWnd(), iTrack, track == nullptr, extraPixels); +} + void CF_NormalizeUTF8(const char *input, const unsigned int mode, char *output, int outputSize) { diff --git a/cfillion/cfillion.hpp b/cfillion/cfillion.hpp index 69a600f5..b54dfca6 100644 --- a/cfillion/cfillion.hpp +++ b/cfillion/cfillion.hpp @@ -66,6 +66,7 @@ bool CF_PCM_Source_SetSectionInfo(PCM_source *section, PCM_source *source, double offset, double length, bool reverse, const double *fade); BOOL CF_GetScrollInfo(HWND, int bar, LPSCROLLINFO); +void CF_SetTcpScroll(MediaTrack *, int extraPixels); void CF_NormalizeUTF8(const char *input, unsigned int mode, char *output, int outputSize);