BR_GetMediaTrackLayouts and Break Lines #760

Closed
X-Raym opened this Issue Aug 21, 2015 · 3 comments

Projects

None yet

3 participants

@X-Raym
X-Raym commented Aug 21, 2015

Hi !

it seems that some MCP names are returned with a break line "\n".
(custom names BUS, VSTi and FX)

We have the problem on this forum thread (starts post 19)
http://forum.cockos.com/showthread.php?p=1561433

Can you reproduce that ?

Cheers !

@Breeder Breeder self-assigned this Aug 21, 2015
@Breeder
Contributor
Breeder commented Aug 21, 2015

Thanks for the report, I'll have a look. In the mean time, can you get some kind of project that displays the issue? I don't remember seeing newlines in any layout names when I tested this function.

@SpacemenTree

Hi Breeder. I am the one who stumbled onto this potencial bug when I was going through the ropes of a lua script with the help of X-Raym.

I don't know if a project will be helpful as I can reproduce this in a new project every time.
As you can read in the corresponding Reaper forum thread, I have three layouts named "BUS", "FX" and "VSTi". The same thing happens in all of them. As I use a custom theme, I did the following test for you benefit:

  1. Open Reaper and create a new Project
  2. Switch to another theme (tested "Spin" and "Eyssina") to check if the problem was somehow with my own theme.
  3. In "Spin" I renamed a layout to "BUS". Result: Same bug behaviour.
  4. In Eyssina, I used "VCA/GM" layout for testing, to discount a problem with "BUS" as name per se. Result: Same bug behaviour.

The lua script I'm using right now is this:

-- Get how many tracks there are --
track_count=reaper.CountTracks(0)

for i=0, track_count-1 do
    cur_track=reaper.GetTrack(0,i)   -- current track number
    mcpLayout, tcpLayout=reaper.BR_GetMediaTrackLayouts(cur_track)  -- get layout of current track
   -- reaper.ShowConsoleMsg(mcpLayout) shows layouts are retrieved correctly


      if mcpLayout=="" then 
      reaper.SetTrackColor(cur_track,0)
      end
      if mcpLayout=="BUS\n" then
      reaper.SetTrackColor(cur_track,0x2266022)
      end
      if mcpLayout=="VSTi\n" then
      reaper.SetTrackColor(cur_track,0x8866022)
      end
      if mcpLayout=="FX\n" then
      reaper.SetTrackColor(cur_track,0x6611022)
      end
      reaper.UpdateArrange() --refresh to see changes
end

Since I added the "\n" as per Heda's suggestion, it works great. If I remove it, it does not identify the layout being tested.

Hope this helps. If you require any more info, or if (even I I can reproduce this everytime in a new project) you want me to send you a .rpp, just let me know.

Thanks for taking time to look into this. And thanks for making it availiable in the first place :)

Take care.

@Breeder
Contributor
Breeder commented Aug 25, 2015

Still can't replicate with Default theme nor one of the Jannes theme I've been using lately.

Can you please upload the theme you're using and the example project for the script you pasted in your last post.

Thanks.

@Breeder Breeder added a commit that closed this issue Sep 10, 2015
@Breeder Breeder Fixes to ReaScript API for manipulating layouts:
+Fixed #760: fixed BR_GetMediaTrackLayouts broken in certain instances
+BR_GetMediaTrackLayout/BR_SetMediaTrackLayout now use native API so it should make them faster
17a001c
@Breeder Breeder closed this in 17a001c Sep 10, 2015
@Breeder Breeder was unassigned by Jeff0S Jan 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment