Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Feature Requests

Reply
 
Thread Tools Display Modes
Old 12-08-2022, 10:03 AM   #1
mlprod
Human being with feelings
 
Join Date: Jul 2015
Location: Stockholm, Sweden
Posts: 1,343
Default It must finally be time for mixer scroll actions!

As the title suggests. Been living with mixer scroll being reversed compared to horiz arrange scroll for years now. Just get it to the action list and all is well.

Thanks Justin and Schwa!=)
__________________
Magnus Lindberg Productions - VRTKL Audio - Redmount Studios
magnuslindberg.com
mlprod is offline   Reply With Quote
Old 12-12-2022, 08:47 PM   #2
skylar_battles
Human being with feelings
 
Join Date: Mar 2022
Posts: 1,522
Default

Interesting. If I remember correctly mine works correctly but I will check again. On you on a Mac? Here is my scroll issue: https://forum.cockos.com/showthread.php?t=273166

Setting up scroll to work “intuitively” gets really confusing, mine is basically there besides this bug I think.

Even though I have it reversed in preferences it doesn’t also work globally as it should and sometime I have to set additional actions to reverse scroll for certain things. Curious about your experience with it all.

I just checked and mine does work correctly! It may be cause I "start" by reversing vertical and horizontal scroll from preferences and then make further adjustments in the actions lists. In the past, I just did it all in the actions list.

Last edited by skylar_battles; 12-12-2022 at 09:37 PM.
skylar_battles is offline   Reply With Quote
Old 12-13-2022, 03:48 AM   #3
mlprod
Human being with feelings
 
Join Date: Jul 2015
Location: Stockholm, Sweden
Posts: 1,343
Default

"Correctly" is subjective, I am asking for mixer scroll actions so one can choose direction.
__________________
Magnus Lindberg Productions - VRTKL Audio - Redmount Studios
magnuslindberg.com
mlprod is offline   Reply With Quote
Old 12-13-2022, 05:03 AM   #4
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

I've made such scripts commerically, but since the sponsor allowed me to post it, here we go:

Scroll one page up:
Code:
local mixer_id, isDocked = reaper.BR_Win32_GetMixerHwnd()
local mcp_id = reaper.JS_Window_FindChild(mixer_id, '', true)
retval, position, pageSize, min, max, trackPos = reaper.JS_Window_GetScrollInfo(mcp_id, 'h')
if retval then
  local newpos = position-pageSize
  if newpos < 0 then newpos = 0 end
  local ok = reaper.JS_Window_SetScrollPos(mcp_id, 'h', newpos)
end
One page down:
Code:
local mixer_id, isDocked = reaper.BR_Win32_GetMixerHwnd()
local mcp_id = reaper.JS_Window_FindChild(mixer_id, '', true)
retval, position, pageSize, min, max, trackPos = reaper.JS_Window_GetScrollInfo(mcp_id, 'h')
if retval then
  local ok = reaper.JS_Window_SetScrollPos(mcp_id, 'h', position+pageSize)
end
Dependencies:
SWS
js_ReaScriptAPI https://forum.cockos.com/showthread.php?t=212174

Last edited by vitalker; 01-03-2023 at 03:29 PM.
vitalker is offline   Reply With Quote
Old 12-13-2022, 11:26 AM   #5
mlprod
Human being with feelings
 
Join Date: Jul 2015
Location: Stockholm, Sweden
Posts: 1,343
Default

Quote:
Originally Posted by vitalker View Post
I've made such scripts commerically, but since the sponsor allowed me to post it, here we go:

Scroll one page up:
PHP Code:
local mixer_idisDocked reaper.BR_Win32_GetMixerHwnd()
local mcp_id reaper.JS_Window_FindChild(mixer_id''true)
retvalpositionpageSizeminmaxtrackPos reaper.JS_Window_GetScrollInfo(mcp_id'h')
if 
retval then
  local newpos 
position-pageSize
  
if newpos 0 then newpos 0 end
  local ok 
reaper.JS_Window_SetScrollPos(mcp_id'h'newpos)
end 
One page down:
PHP Code:
local mixer_idisDocked reaper.BR_Win32_GetMixerHwnd()
local mcp_id reaper.JS_Window_FindChild(mixer_id''true)
retvalpositionpageSizeminmaxtrackPos reaper.JS_Window_GetScrollInfo(mcp_id'h')
if 
retval then
  local ok 
reaper.JS_Window_SetScrollPos(mcp_id'h'position+pageSize)
end 
Dependencies:
SWS
js_ReaScriptAPI https://forum.cockos.com/showthread.php?t=212174
Cool will try it! Possible to get it to do one track at a time instead?
__________________
Magnus Lindberg Productions - VRTKL Audio - Redmount Studios
magnuslindberg.com
mlprod is offline   Reply With Quote
Old 12-13-2022, 11:33 AM   #6
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by mlprod View Post
Cool will try it! Possible to get it to do one track at a time instead?
I'll see whether it is easy.
vitalker is offline   Reply With Quote
Old 12-13-2022, 04:32 PM   #7
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Wasn't easy, but I've made it.

Up:
Code:
i = reaper.GetMediaTrackInfo_Value(reaper.GetMixerScroll(), 'IP_TRACKNUMBER')
while i>2 and not reaper.IsTrackVisible(reaper.GetTrack(0,i-2), true) do
  i = i-1
end
if i>=2 then reaper.SetMixerScroll(reaper.GetTrack(0,i-2)) end
Down:
Code:
i = reaper.GetMediaTrackInfo_Value(reaper.GetMixerScroll(), 'IP_TRACKNUMBER')
while i<reaper.CountTracks(0)-1 and not reaper.IsTrackVisible(reaper.GetTrack(0,i), true) do
  i = i+1
end
reaper.SetMixerScroll(reaper.GetTrack(0,i))

Last edited by vitalker; 01-03-2023 at 03:29 PM.
vitalker is offline   Reply With Quote
Old 12-14-2022, 02:33 PM   #8
mlprod
Human being with feelings
 
Join Date: Jul 2015
Location: Stockholm, Sweden
Posts: 1,343
Default

Quote:
Originally Posted by vitalker View Post
Wasn't easy, but I've made it.

Up:
PHP Code:
reaper.GetMediaTrackInfo_Value(reaper.GetMixerScroll(), 'IP_TRACKNUMBER')
while 
i>and not reaper.IsTrackVisible(reaper.GetTrack(0,i-2), true) do
  
i-1
end
if i>=2 then reaper.SetMixerScroll(reaper.GetTrack(0,i-2)) end 
Down:
PHP Code:
reaper.GetMediaTrackInfo_Value(reaper.GetMixerScroll(), 'IP_TRACKNUMBER')
while 
i<reaper.CountTracks(0)-and not reaper.IsTrackVisible(reaper.GetTrack(0,i), true) do
  
i+1
end
reaper
.SetMixerScroll(reaper.GetTrack(0,i)) 
Thanks a lot for your effort. Are these ReaScrips though?
__________________
Magnus Lindberg Productions - VRTKL Audio - Redmount Studios
magnuslindberg.com
mlprod is offline   Reply With Quote
Old 12-14-2022, 02:45 PM   #9
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by mlprod View Post
Thanks a lot for your effort. Are these ReaScrips though?
Hm, yes. What else they could be?
vitalker is offline   Reply With Quote
Old 12-15-2022, 03:38 PM   #10
mlprod
Human being with feelings
 
Join Date: Jul 2015
Location: Stockholm, Sweden
Posts: 1,343
Default

Quote:
Originally Posted by vitalker View Post
Hm, yes. What else they could be?
Hehe, asking cause that code pasted into a new script doesn't "compile" for me. Anyway, also realised that there's probably no way to turn off regular mixer mouse wheel scroll anyway which would probably conflict with this?
__________________
Magnus Lindberg Productions - VRTKL Audio - Redmount Studios
magnuslindberg.com
mlprod is offline   Reply With Quote
Old 12-15-2022, 03:52 PM   #11
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by mlprod View Post
Hehe, asking cause that code pasted into a new script doesn't "compile" for me. Anyway, also realised that there's probably no way to turn off regular mixer mouse wheel scroll anyway which would probably conflict with this?
Show me what are you doing.
Not sure what do you mean.
vitalker is offline   Reply With Quote
Old 12-15-2022, 11:15 PM   #12
Javier Robledo
Human being with feelings
 
Javier Robledo's Avatar
 
Join Date: Jul 2014
Posts: 636
Default

Great as always Vitalker ¡¡¡

Javier Robledo is online now   Reply With Quote
Old 12-16-2022, 09:12 AM   #13
mlprod
Human being with feelings
 
Join Date: Jul 2015
Location: Stockholm, Sweden
Posts: 1,343
Default

Quote:
Originally Posted by vitalker View Post
Show me what are you doing.
Not sure what do you mean.
Probably something wrong...just copy paste.

__________________
Magnus Lindberg Productions - VRTKL Audio - Redmount Studios
magnuslindberg.com
mlprod is offline   Reply With Quote
Old 12-16-2022, 09:29 AM   #14
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by mlprod View Post
Probably something wrong...just copy paste.

Don't know what is your browser or system, but copy it to a text editor and then to IDE. It works here, so don't know what is blocking copying. Looks like your OS doesn't like spaces.
vitalker is offline   Reply With Quote
Old 12-16-2022, 02:36 PM   #15
mlprod
Human being with feelings
 
Join Date: Jul 2015
Location: Stockholm, Sweden
Posts: 1,343
Default

Quote:
Originally Posted by vitalker View Post
Don't know what is your browser or system, but copy it to a text editor and then to IDE. It works here, so don't know what is blocking copying. Looks like your OS doesn't like spaces.
You are right, the spaces weren't "translated" correctly in the IDE. Anyway, thanks for the effort, seems to work fine! Though me myself need actions to be able to use the mouse wheel which of course still is reverse scrolling in the mixer compared to what I would like.
__________________
Magnus Lindberg Productions - VRTKL Audio - Redmount Studios
magnuslindberg.com
mlprod is offline   Reply With Quote
Old 01-02-2023, 06:31 AM   #16
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by mlprod View Post
You are right, the spaces weren't "translated" correctly in the IDE. Anyway, thanks for the effort, seems to work fine! Though me myself need actions to be able to use the mouse wheel which of course still is reverse scrolling in the mixer compared to what I would like.
Is your mouse wheel assigned to some action? I don't remember whether mixer offers actions accessible via mouse wheel.
vitalker is offline   Reply With Quote
Old 01-02-2023, 11:01 AM   #17
mlprod
Human being with feelings
 
Join Date: Jul 2015
Location: Stockholm, Sweden
Posts: 1,343
Default

Quote:
Originally Posted by vitalker View Post
Is your mouse wheel assigned to some action? I don't remember whether mixer offers actions accessible via mouse wheel.
Probaby but this needs to be a mouse wheel specific action.
__________________
Magnus Lindberg Productions - VRTKL Audio - Redmount Studios
magnuslindberg.com
mlprod is offline   Reply With Quote
Old 01-02-2023, 11:07 AM   #18
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by mlprod View Post
Probaby but this needs to be a mouse wheel specific action.
Okay, I'll see what I can do. Stay tuned.
vitalker is offline   Reply With Quote
Old 01-03-2023, 03:51 PM   #19
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

You wanted reversed. It means when you scroll up, mixer shows next tracks. When you scroll down, mixer shows previous tracks. MCP and TCP hijack scroll, so if you want it to work, scroll outside mixer or tracks panels, for example over arrange window.

Code:
local _,_,_,_,_,_,val = reaper.get_action_context()
if val>0 then
  --down
  i = reaper.GetMediaTrackInfo_Value(reaper.GetMixerScroll(), 'IP_TRACKNUMBER')
  while i<reaper.CountTracks(0)-1 and not reaper.IsTrackVisible(reaper.GetTrack(0,i), true) do
    i = i+1
  end
  reaper.SetMixerScroll(reaper.GetTrack(0,i))
elseif val<0 then
  --up
  i = reaper.GetMediaTrackInfo_Value(reaper.GetMixerScroll(), 'IP_TRACKNUMBER')
  while i>2 and not reaper.IsTrackVisible(reaper.GetTrack(0,i-2), true) do
    i = i-1
  end
  if i>=2 then reaper.SetMixerScroll(reaper.GetTrack(0,i-2)) end
end
vitalker is offline   Reply With Quote
Old 01-05-2023, 04:09 PM   #20
mlprod
Human being with feelings
 
Join Date: Jul 2015
Location: Stockholm, Sweden
Posts: 1,343
Default

Quote:
Originally Posted by vitalker View Post
You wanted reversed. It means when you scroll up, mixer shows next tracks. When you scroll down, mixer shows previous tracks. MCP and TCP hijack scroll, so if you want it to work, scroll outside mixer or tracks panels, for example over arrange window.

Code:
local _,_,_,_,_,_,val = reaper.get_action_context()
if val>0 then
  --down
  i = reaper.GetMediaTrackInfo_Value(reaper.GetMixerScroll(), 'IP_TRACKNUMBER')
  while i<reaper.CountTracks(0)-1 and not reaper.IsTrackVisible(reaper.GetTrack(0,i), true) do
    i = i+1
  end
  reaper.SetMixerScroll(reaper.GetTrack(0,i))
elseif val<0 then
  --up
  i = reaper.GetMediaTrackInfo_Value(reaper.GetMixerScroll(), 'IP_TRACKNUMBER')
  while i>2 and not reaper.IsTrackVisible(reaper.GetTrack(0,i-2), true) do
    i = i-1
  end
  if i>=2 then reaper.SetMixerScroll(reaper.GetTrack(0,i-2)) end
end
Thanks for the effort, it works indeed.
Only sad thing if course is I cant have the mouse on the mixer. But yes thanks man!
/m
__________________
Magnus Lindberg Productions - VRTKL Audio - Redmount Studios
magnuslindberg.com
mlprod is offline   Reply With Quote
Old 01-05-2023, 04:24 PM   #21
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by mlprod View Post
Thanks for the effort, it works indeed.
Only sad thing if course is I cant have the mouse on the mixer. But yes thanks man!
/m
Yeah, perhaps there is something for intercepting mouse. I'll check whether Julian Sader has some function for this.
vitalker is offline   Reply With Quote
Old 01-07-2023, 01:00 PM   #22
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

I've spent too much time on this... At least it works. Don't assign mousewheel to it, because it works without it and now it runs in background (deferred script).

Code:
function main()
  mixer_id, _ = reaper.BR_Win32_GetMixerHwnd()
  reaper.JS_WindowMessage_Intercept(mixer_id, 'WM_MOUSEWHEEL', false)
  window, _, _ = reaper.BR_GetMouseCursorContext()
  _, _, time, _, val, _, _ = reaper.JS_WindowMessage_Peek(mixer_id, 'WM_MOUSEWHEEL')
  if window == 'mcp' and (time_new < time or time_new == 0) then
    time_new = time
    if val>0 then
      --down
      i = reaper.GetMediaTrackInfo_Value(reaper.GetMixerScroll(), 'IP_TRACKNUMBER')
      while i<reaper.CountTracks(0)-1 and not reaper.IsTrackVisible(reaper.GetTrack(0,i), true) do
        i = i+1
      end
      reaper.SetMixerScroll(reaper.GetTrack(0,i))
    elseif val<0 then
      --up
      i = reaper.GetMediaTrackInfo_Value(reaper.GetMixerScroll(), 'IP_TRACKNUMBER')
      while i>2 and not reaper.IsTrackVisible(reaper.GetTrack(0,i-2), true) do
        i = i-1
      end
      if i>=2 then reaper.SetMixerScroll(reaper.GetTrack(0,i-2)) end
    end
  end
  reaper.defer(main)
end

time_new = 0
main()
reaper.atexit(reaper.JS_WindowMessage_ReleaseAll())
vitalker is offline   Reply With Quote
Old 01-08-2023, 07:36 AM   #23
mlprod
Human being with feelings
 
Join Date: Jul 2015
Location: Stockholm, Sweden
Posts: 1,343
Default

Wow great work man! Expect a donation very soon.

Thanks/m
__________________
Magnus Lindberg Productions - VRTKL Audio - Redmount Studios
magnuslindberg.com
mlprod is offline   Reply With Quote
Old 01-08-2023, 07:37 AM   #24
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by mlprod View Post
Wow great work man! Expect a donation very soon.

Thanks/m
Thanks, received! Did you try it?

Last edited by vitalker; 01-08-2023 at 08:40 AM.
vitalker is offline   Reply With Quote
Old 01-08-2023, 09:10 AM   #25
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by vitalker View Post
Thanks, received! Did you try it?
I didn't try whether it is possible, but maybe you would want normal Reaper scrolling, but with reversed response?
vitalker is offline   Reply With Quote
Old 01-08-2023, 03:01 PM   #26
mlprod
Human being with feelings
 
Join Date: Jul 2015
Location: Stockholm, Sweden
Posts: 1,343
Default

Quote:
Originally Posted by vitalker View Post
I didn't try whether it is possible, but maybe you would want normal Reaper scrolling, but with reversed response?
Seem to work fine with mouse wheel, less good with trackpad. The script above is the direction I want.
__________________
Magnus Lindberg Productions - VRTKL Audio - Redmount Studios
magnuslindberg.com
mlprod is offline   Reply With Quote
Old 01-08-2023, 03:19 PM   #27
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by mlprod View Post
Seem to work fine with mouse wheel, less good with trackpad. The script above is the direction I want.
So what can be changed then?
vitalker is offline   Reply With Quote
Old 01-09-2023, 08:50 AM   #28
mlprod
Human being with feelings
 
Join Date: Jul 2015
Location: Stockholm, Sweden
Posts: 1,343
Default

Quote:
Originally Posted by vitalker View Post
So what can be changed then?
It's great as it is! Thx man.
__________________
Magnus Lindberg Productions - VRTKL Audio - Redmount Studios
magnuslindberg.com
mlprod is offline   Reply With Quote
Old 01-09-2023, 08:59 AM   #29
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by mlprod View Post
It's great as it is! Thx man.
But if it can be improved with little effort, I guess it's worth it.
vitalker is offline   Reply With Quote
Old 01-10-2023, 09:01 AM   #30
mlprod
Human being with feelings
 
Join Date: Jul 2015
Location: Stockholm, Sweden
Posts: 1,343
Default

Quote:
Originally Posted by vitalker View Post
But if it can be improved with little effort, I guess it's worth it.
Happy with it as it is!
__________________
Magnus Lindberg Productions - VRTKL Audio - Redmount Studios
magnuslindberg.com
mlprod is offline   Reply With Quote
Old 01-10-2023, 09:05 AM   #31
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by mlprod View Post
Happy with it as it is!
All right, I hope it will be useful.
vitalker is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:07 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.