Skip to content

Commit

Permalink
Add hidden items check to F7/F8 sync
Browse files Browse the repository at this point in the history
  • Loading branch information
chmaha committed Feb 21, 2025
1 parent 1a59ca9 commit ee8cece
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 2 deletions.
30 changes: 29 additions & 1 deletion ReaClassical/ReaClassical_Horizontal Workflow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ local create_single_mixer, route_tracks, create_track_table
local process_name, show_track_name_dialog
local save_track_settings, reset_track_settings, write_to_mixer
local rearrange_tracks, reset_mixer_order, copy_track_names_from_dest
local process_dest
local process_dest, check_hidden_track_items

---------------------------------------------------------------------

Expand Down Expand Up @@ -177,6 +177,12 @@ function main()

PreventUIRefresh(-1)

if check_hidden_track_items(num_of_tracks) then
ShowMessageBox("Warning: Items have been pasted or recorded on hidden tracks! " ..
"Open the Track Manager via the View menu, enable the hidden tracks on TCP then delete any items",
"Horizontal Workflow", 0)
end

if num_pre_selected > 0 then
Main_OnCommand(40297, 0) --unselect_all
SetOnlyTrackSelected(pre_selected[1])
Expand Down Expand Up @@ -928,4 +934,26 @@ end

---------------------------------------------------------------------

function check_hidden_track_items(track_count)
for i = 0, track_count - 1 do
local track = GetTrack(0, i)
if track then
local _, mixer_state = GetSetMediaTrackInfo_String(track, "P_EXT:mixer", "", false)
local _, aux_state = GetSetMediaTrackInfo_String(track, "P_EXT:aux", "", false)
local _, submix_state = GetSetMediaTrackInfo_String(track, "P_EXT:submix", "", false)
local _, rcmaster_state = GetSetMediaTrackInfo_String(track, "P_EXT:rcmaster", "", false)

if mixer_state ~= "" or aux_state ~= "" or submix_state ~= "" or rcmaster_state ~= "" then
local item_count = CountTrackMediaItems(track)
if item_count > 0 then
return true
end
end
end
end
return false
end

---------------------------------------------------------------------

main()
32 changes: 31 additions & 1 deletion ReaClassical/ReaClassical_Vertical Workflow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ local process_name, reset_spacers, sync, show_track_name_dialog
local save_track_settings, reset_track_settings, write_to_mixer
local check_mixer_order, rearrange_tracks, reset_mixer_order
local copy_track_names_from_dest, process_dest, move_items_to_first_source_group
local check_hidden_track_items

---------------------------------------------------------------------

local SWS_exists = APIExists("CF_GetSWSVersion")
if not SWS_exists then
MB('Please install SWS/S&M extension before running this function', 'Error: Missing Extension', 0)
MB('Please install SWS/S&M extension before running this function'
, 'Error: Missing Extension', 0)
return
end

Expand Down Expand Up @@ -264,6 +266,12 @@ function main()

PreventUIRefresh(-1)

if check_hidden_track_items(num_of_tracks) then
ShowMessageBox("Warning: Items have been pasted or recorded on hidden tracks! " ..
"Open the Track Manager via the View menu, enable the hidden tracks on TCP then delete any items",
"Horizontal Workflow", 0)
end

if num_pre_selected > 0 then
Main_OnCommand(40297, 0) --unselect_all
SetOnlyTrackSelected(pre_selected[1])
Expand Down Expand Up @@ -1166,4 +1174,26 @@ end

---------------------------------------------------------------------

function check_hidden_track_items(track_count)
for i = 0, track_count - 1 do
local track = GetTrack(0, i)
if track then
local _, mixer_state = GetSetMediaTrackInfo_String(track, "P_EXT:mixer", "", false)
local _, aux_state = GetSetMediaTrackInfo_String(track, "P_EXT:aux", "", false)
local _, submix_state = GetSetMediaTrackInfo_String(track, "P_EXT:submix", "", false)
local _, rcmaster_state = GetSetMediaTrackInfo_String(track, "P_EXT:rcmaster", "", false)

if mixer_state ~= "" or aux_state ~= "" or submix_state ~= "" or rcmaster_state ~= "" then
local item_count = CountTrackMediaItems(track)
if item_count > 0 then
return true
end
end
end
end
return false
end

---------------------------------------------------------------------

main()

0 comments on commit ee8cece

Please sign in to comment.