Skip to content

Commit

Permalink
Mass clean-up of unused functions and variables
Browse files Browse the repository at this point in the history
  • Loading branch information
chmaha committed Feb 24, 2024
1 parent 5b44b06 commit 3dc7540
Show file tree
Hide file tree
Showing 44 changed files with 128 additions and 217 deletions.
2 changes: 2 additions & 0 deletions ReaClassical/ReaClassical.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
@version 24.4.6
@changelog
Clean up index file etc
Add local section at start of each file
Mass clean-up of unused functions and variables
@metapackage
@provides
[main] ReaClassical_Add Destination IN marker.lua
Expand Down
3 changes: 3 additions & 0 deletions ReaClassical/ReaClassical_3-point Insert Edit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
]]

for key in pairs(reaper) do _G[key] = reaper[key] end
local main, markers, select_matching_folder, split_at_dest_in, create_crossfades, clean_up
local lock_items, unlock_items, ripple_lock_mode, create_dest_in, return_xfade_length, xfade
local get_first_last_items

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

Expand Down
2 changes: 2 additions & 0 deletions ReaClassical/ReaClassical_3-point edit replace.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

for key in pairs(reaper) do _G[key] = reaper[key] end

local main

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

function main()
Expand Down
2 changes: 2 additions & 0 deletions ReaClassical/ReaClassical_Add Aux or Submix.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

for key in pairs(reaper) do _G[key] = reaper[key] end

local main, folder_check

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

function main()
Expand Down
2 changes: 2 additions & 0 deletions ReaClassical/ReaClassical_Add Destination IN marker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

for key in pairs(reaper) do _G[key] = reaper[key] end

local main

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

function main()
Expand Down
2 changes: 2 additions & 0 deletions ReaClassical/ReaClassical_Add Destination OUT Marker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

for key in pairs(reaper) do _G[key] = reaper[key] end

local main

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

function main()
Expand Down
2 changes: 2 additions & 0 deletions ReaClassical/ReaClassical_Add RoomTone Track.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

for key in pairs(reaper) do _G[key] = reaper[key] end

local main, folder_check

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

function main()
Expand Down
2 changes: 2 additions & 0 deletions ReaClassical/ReaClassical_Add Source IN marker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

for key in pairs(reaper) do _G[key] = reaper[key] end

local main, folder_check, get_track_number

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

function main()
Expand Down
2 changes: 2 additions & 0 deletions ReaClassical/ReaClassical_Add Source OUT marker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

for key in pairs(reaper) do _G[key] = reaper[key] end

local main, folder_check, get_track_number

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

function main()
Expand Down
2 changes: 2 additions & 0 deletions ReaClassical/ReaClassical_Audition.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

for key in pairs(reaper) do _G[key] = reaper[key] end

local main, solo, bus_check, rt_check, mixer, on_stop

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

function main()
Expand Down
4 changes: 4 additions & 0 deletions ReaClassical/ReaClassical_Classical Crossfade Editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

for key in pairs(reaper) do _G[key] = reaper[key] end

local main, select_check, exit_check, lock_previous_items, fadeStart
local fadeEnd, zoom, view, lock_items, unlock_items, save_color
local paint, load_color, move_cur_to_mid

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

function main()
Expand Down
2 changes: 2 additions & 0 deletions ReaClassical/ReaClassical_Classical Crossfade.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

for key in pairs(reaper) do _G[key] = reaper[key] end

local main, return_xfade_length

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

function main()
Expand Down
3 changes: 3 additions & 0 deletions ReaClassical/ReaClassical_Classical Take Record.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

for key in pairs(reaper) do _G[key] = reaper[key] end

local main, solo, bus_check, rt_check, mixer, track_check
local load_prefs, save_prefs

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

function main()
Expand Down
2 changes: 2 additions & 0 deletions ReaClassical/ReaClassical_Colorize.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

for key in pairs(reaper) do _G[key] = reaper[key] end

local main

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

function main()
Expand Down
5 changes: 5 additions & 0 deletions ReaClassical/ReaClassical_Create CD Markers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

for key in pairs(reaper) do _G[key] = reaper[key] end

local main, get_info, cd_markers, find_current_start, create_marker
local renumber_markers, add_pregap, find_project_end, end_marker
local frame_check, save_metadata, save_codes, add_codes, delete_markers
local empty_items_check, return_custom_length, start_check

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

function main()
Expand Down
29 changes: 3 additions & 26 deletions ReaClassical/ReaClassical_Create Folder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

for key in pairs(reaper) do _G[key] = reaper[key] end

local main, track_check, folder_check, remove_track_groups
local media_razor_group

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

function main()
Expand Down Expand Up @@ -99,30 +102,4 @@ end

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

function link_controls()
local first_track = GetTrack(0, 0)
SetOnlyTrackSelected(first_track)
local select_children = NamedCommandLookup("_SWS_SELCHILDREN2")
Main_OnCommand(select_children, 0) -- SWS: Select children of selected folder track(s)
local folder_tracks = CountSelectedTracks(0)
local i = 0
while i < folder_tracks do
local track = GetSelectedTrack(0, i)
GetSetTrackGroupMembership(track, "VOLUME_LEAD", 2 ^ i, 2 ^ i)
GetSetTrackGroupMembership(track, "VOLUME_FOLLOW", 2 ^ i, 2 ^ i)
GetSetTrackGroupMembership(track, "PAN_LEAD", 2 ^ i, 2 ^ i)
GetSetTrackGroupMembership(track, "PAN_FOLLOW", 2 ^ i, 2 ^ i)
GetSetTrackGroupMembership(track, "POLARITY_LEAD", 2 ^ i, 2 ^ i)
GetSetTrackGroupMembership(track, "POLARITY_FOLLOW", 2 ^ i, 2 ^ i)
GetSetTrackGroupMembership(track, "AUTOMODE_LEAD", 2 ^ i, 2 ^ i)
GetSetTrackGroupMembership(track, "AUTOMODE_FOLLOW", 2 ^ i, 2 ^ i)
GetSetTrackGroupMembership(track, "MUTE_LEAD", 2 ^ i, 2 ^ i)
GetSetTrackGroupMembership(track, "MUTE_FOLLOW", 2 ^ i, 2 ^ i)
i = i + 1
end
SetOnlyTrackSelected(first_track)
end

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

main()
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

for key in pairs(reaper) do _G[key] = reaper[key] end

local main, create_destination_group, solo, bus_check, rt_check
local mixer, folder_check, sync_routing_and_fx, create_source_groups
local media_razor_group, remove_track_groups, link_controls
local folder_size_check, add_spacer

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

function main()
Expand Down Expand Up @@ -185,7 +190,7 @@ function sync_routing_and_fx()
Main_OnCommand(40421, 0) --select all items on track

local selected_tracks = CountSelectedTracks(0)
for i = 1, selected_tracks, 1 do
for _ = 1, selected_tracks, 1 do
Main_OnCommand(40117, 0) -- Move items up to previous folder
end
Main_OnCommand(40005, 0) --delete selected tracks
Expand Down
2 changes: 2 additions & 0 deletions ReaClassical/ReaClassical_Delete All S-D markers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

for key in pairs(reaper) do _G[key] = reaper[key] end

local main

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

function main()
Expand Down
2 changes: 2 additions & 0 deletions ReaClassical/ReaClassical_Delete Leaving Silence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

for key in pairs(reaper) do _G[key] = reaper[key] end

local main, source_markers, select_matching_folder

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

function main()
Expand Down
3 changes: 3 additions & 0 deletions ReaClassical/ReaClassical_Delete With Ripple.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

for key in pairs(reaper) do _G[key] = reaper[key] end

local main, source_markers, select_matching_folder, lock_items
local unlock_items, ripple_lock_mode, return_xfade_length, xfade

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

function main()
Expand Down
6 changes: 4 additions & 2 deletions ReaClassical/ReaClassical_Duplicate folder (No items).lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

for key in pairs(reaper) do _G[key] = reaper[key] end

local main, solo, bus_check, rt_check, mixer, track_check
local media_razor_group, add_spacer

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

function main()
Expand Down Expand Up @@ -68,7 +71,6 @@ function solo()
track = GetTrack(0, i)
if IsTrackSelected(track) == false then
SetMediaTrackInfo_Value(track, "I_SOLO", 0)
i = i + 1
end
end
end
Expand Down Expand Up @@ -127,7 +129,7 @@ function media_razor_group(track)
local first_track = GetTrack(0, 0)
SetOnlyTrackSelected(first_track)
local tracks_per_group
for i = 1, num_of_folders, 1 do
for _ = 1, num_of_folders, 1 do
local select_children = NamedCommandLookup("_SWS_SELCHILDREN2")
Main_OnCommand(select_children, 0) -- SWS_SELCHILDREN2
tracks_per_group = CountSelectedTracks(0)
Expand Down
10 changes: 2 additions & 8 deletions ReaClassical/ReaClassical_Edit Classical Crossfade.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

for key in pairs(reaper) do _G[key] = reaper[key] end

local main

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

function main()
Expand Down Expand Up @@ -56,16 +58,9 @@ function main()
local two_pos = GetMediaItemInfo_Value(item_two, "D_POSITION")
BR_GetMouseCursorContext()
local mouse_pos = BR_GetMouseCursorContext_Position()
local item_hover = BR_GetMouseCursorContext_Item()
BR_GetMouseCursorContext()
local mouse_pos = BR_GetMouseCursorContext_Position()
local item_hover = BR_GetMouseCursorContext_Item()

Main_OnCommand(40289, 0) -- Item: Unselect (clear selection of) all items
local end_of_one = one_pos + one_length
local overlap = end_of_one - two_pos
local mouse_to_item_two = two_pos - mouse_pos
local total_time = 2 * mouse_to_item_two + overlap

if mouse_pos < two_pos then
SetMediaItemInfo_Value(item_one, "C_LOCK", 0) --unlock item 1
Expand All @@ -84,7 +79,6 @@ function main()
elseif mouse_pos > two_pos then
SetMediaItemInfo_Value(item_one, "C_LOCK", 0) --unlock item 1
SetEditCurPos(mouse_pos, false, false)
curpos = GetCursorPosition()
SetMediaItemSelected(item_one, true)
Main_OnCommand(41991, 0) -- toggle ripple-all OFF
Main_OnCommand(41311, 0) -- extend item right
Expand Down
2 changes: 2 additions & 0 deletions ReaClassical/ReaClassical_ExplodeMultiChannel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

for key in pairs(reaper) do _G[key] = reaper[key] end

local main

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

function main()
Expand Down
69 changes: 0 additions & 69 deletions ReaClassical/ReaClassical_Group Play.lua

This file was deleted.

2 changes: 2 additions & 0 deletions ReaClassical/ReaClassical_Help.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

for key in pairs(reaper) do _G[key] = reaper[key] end

local main, file_exists

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

function main()
Expand Down
Loading

0 comments on commit 3dc7540

Please sign in to comment.