129 lines
3.6 KiB
Lua
129 lines
3.6 KiB
Lua
--------------------------------------
|
|
----------// HEADER //----------------
|
|
--------------------------------------
|
|
--[[
|
|
* REALIVE: Reaper Setup for a Complete Live Playback Engine
|
|
* ReaScript Name: Realive_ProjectTabsList_Refresh.lua
|
|
* Description: ProjectTabsList_Refresh
|
|
* Instructions:
|
|
* Author: Alex Paquette
|
|
* Repository:
|
|
* Repository URI:
|
|
* File URI:
|
|
* Licence: GPL v3
|
|
* Forum Thread:
|
|
* Forum Thread URI:
|
|
* REAPER: 5
|
|
* Extensions: SWS/S&M
|
|
* Version: 1.0
|
|
--]]
|
|
|
|
--[[
|
|
* Changelog:
|
|
* v1.0 (2019-06-02)
|
|
+ Initial Release
|
|
--]]
|
|
|
|
|
|
--------------------------------------
|
|
----------// VARIABLES //-------------
|
|
--------------------------------------
|
|
|
|
|
|
|
|
local reaper = reaper -------// Performance Enhancement //----------
|
|
|
|
-----// Window Set Numbers //------------------------------
|
|
local PlayViewWindowSet = 01 -- Enter Window Set Number Used for the "Live Play" View
|
|
local AllTracksViewWindowSet = 02 -- Enter the Window Set Number for the "Show All Tracks" View
|
|
local WindowSetBaseNumber = 40453
|
|
local PlayView_cmdID = WindowSetBaseNumber+PlayViewWindowSet
|
|
local AllView_cmdID = WindowSetBaseNumber+AllTracksViewWindowSet
|
|
|
|
-----// Other Variables //------------------------------
|
|
|
|
|
|
-----// gmem Variables //------------------------------
|
|
local gmemSect = 'Realive_Gmem'
|
|
local gmem_idx_PlaylistState = 11
|
|
local gmem_idx_Management = 12
|
|
local gmem_idx_PlaylistState_Clean = 32
|
|
local gmem_idx_PlaylistCount_Reaper = 30
|
|
local gmem_idx_PlaylistCount_Realive = 31
|
|
local gmemPlaylist_SaveRequest = 1
|
|
local gmemPlaylist_SaveRefused = 2
|
|
local gmemPlaylist_Initialize = 3
|
|
local gmemPlaylist_RealiveListItem_Remove = 4
|
|
local gmemPlaylist_RealiveListItem_Add = 5
|
|
local gmemPlaylist_RealiveListItem_Update = 6
|
|
|
|
local gmemPlaylist_ProjectTabs_CleanStatus = 9
|
|
local gmem_idxRead_Mngmt = reaper.gmem_read(gmem_idx_Management)
|
|
|
|
|
|
|
|
|
|
|
|
function PathStuff()
|
|
local save_targetPath = ''
|
|
local save_lastPath = ''
|
|
if reaper.HasExtState('Realive_ProjectFolder', 'lastPath') then
|
|
save_lastPath = reaper.GetExtState('Realive_ProjectFolder', 'lastPath')
|
|
end
|
|
if reaper.HasExtState('Realive_ProjectFolder', 'defaultPath') then
|
|
save_defaultPath = reaper.GetExtState('Realive_ProjectFolder', 'defaultPath')
|
|
end
|
|
if save_lastPath ~= '' then save_targetPath = save_lastPath
|
|
elseif save_defaultPath ~= '' then save_targetPath = save_defaultPath
|
|
end
|
|
end
|
|
|
|
-----------------------------------------------------------
|
|
-----// SAVE File FUNCTION //-------------------------------
|
|
-----------------------------------------------------------
|
|
function SaveFile()
|
|
-- local r, fn = reaper.JS_Dialog_BrowseForSaveFile('Save RPP', '', '', '*.RPP')
|
|
|
|
-- if r == 1 then
|
|
--
|
|
-- end
|
|
-- return r
|
|
end
|
|
|
|
--[[
|
|
function SaveFile()
|
|
local projName = reaper.GetProjectName(0, '')
|
|
local dirtySt = reaper.IsProjectDirty(0)
|
|
if dirtySt == 0 then return end
|
|
doYouWantToSave = reaper.ShowMessageBox( 'Save Project '..projName..'before closing?', 'REAPER Query', 3) -- Yes = 6, No = 7, Cancel = 2
|
|
if doYouWantToSave == 6 then
|
|
local r, fn = reaper.JS_Dialog_BrowseForSaveFile('Save RPP', '', '', '*.RPP')
|
|
if r == 1 then
|
|
reaper.Main_saveProject(fn)
|
|
end
|
|
end
|
|
return doYouWantToSave
|
|
end
|
|
--]]
|
|
|
|
|
|
-----------------------------------------------------------
|
|
-----------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
------------------------------------------
|
|
---------// RUN FUNCTION //--------------
|
|
------------------------------------------
|
|
function run()
|
|
reaper.gmem_write(gmem_idx_Management, gmemPlaylist_RealiveListItem_Remove)
|
|
end
|
|
|
|
------------------------------------------
|
|
---------// RUNTIME //-------------------
|
|
------------------------------------------
|
|
reaper.gmem_attach(gmemSect)
|
|
run() |