Old 08-05-2019, 06:57 AM   #1
Travesty
Human being with feelings
 
Travesty's Avatar
 
Join Date: Nov 2014
Posts: 798
Default Rescan database in media explorer

Is there any way to force a rescan of a database in media explorer?

I'd like to refresh the database automatically after a file has been rendered to it, or after a version control update.
Travesty is offline   Reply With Quote
Old 08-05-2019, 09:13 AM   #2
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Oblivion
Posts: 10,252
Default

Right click the database. Don't know of a way to make it automatic tho.
__________________
foxyyymusic
foxAsteria is offline   Reply With Quote
Old 08-05-2019, 09:34 AM   #3
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

@Travesty
Post that into my Ultraschall-API and I'll have a look at it.
Maybe I can do something about it..
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 08-05-2019, 10:42 AM   #4
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,874
Default

My databases related scripts just close and reopen the media explorer. Works nicely.
X-Raym is offline   Reply With Quote
Old 08-06-2019, 07:36 AM   #5
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Do you mean by database refreshing the file-listview?
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 08-06-2019, 07:45 AM   #6
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,874
Default

Oops I read too quickly,


What I meant is that refreshing a database file which have been altered can be done by closing and reopening media explorer,


but for the OP, who whant the file to be added to that database,
this means have a previous step: a script capable of adding a file to a database.


I have the code needed to do such things (database parser, file analysis etc) but I reserved to custom dev (it is not in free scripts).


Though, ricghtclick databse -> Rescan for new files is pretty fast so unless the database is really huge it may not worth it.
X-Raym is offline   Reply With Quote
Old 08-06-2019, 07:48 AM   #7
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Does this solve the issue? Needs Ultraschall-API to be installed:

Code:
function ultraschall.GetMediaExplorerHWND()
  local translation=reaper.JS_Localize("Media Explorer", "common")
  local auto_play=reaper.JS_Localize("Auto play", "explorer_DLG_101")
  local vol=reaper.JS_Localize("vol", "explorer_DLG_101")
  local navigate_backwards=reaper.JS_Localize("Navigate backwards", "access")

  local count_hwnds, hwnd_array, hwnd_adresses = ultraschall.Windows_Find(translation, true)
  if count_hwnds==0 then return nil
  else
    for i=count_hwnds, 1, -1 do
      if ultraschall.HasHWNDChildWindowNames(hwnd_array[i], 
                                            auto_play.."\0"..
                                            vol.."\0"..
                                            navigate_backwards)==true then return hwnd_array[i] end
    end
  end
  return nil
end 

function ultraschall.UpdateMediaExplorer()
  local HWND=ultraschall.GetMediaExplorerHWND()
  if ultraschall.IsValidHWND(HWND)==false then ultraschall.AddErrorMessage("UpdateMediaExplorer", "", "Can't get MediaExplorer-HWND. Is it opened?", -1) return false end
  return reaper.JS_Window_OnCommand(HWND, 40018)
end
Just run ultraschall.UpdateMediaExplorer() and it shows recently updated files in the Media Explorer.
Uses the refresh-action in MediaExplorer-section.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 08-06-2019, 10:11 AM   #8
Travesty
Human being with feelings
 
Travesty's Avatar
 
Join Date: Nov 2014
Posts: 798
Default

I'll give that a go, thanks
Travesty is offline   Reply With Quote
Old 09-11-2019, 08:42 AM   #9
Travesty
Human being with feelings
 
Travesty's Avatar
 
Join Date: Nov 2014
Posts: 798
Default

This script refreshes the media explorer. I would like to initiate a rescan of a particular database on startup.
Travesty is offline   Reply With Quote
Old 09-11-2019, 12:44 PM   #10
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

How do you trigger the update by mouse currently?
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine 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 01:53 AM.


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