Kara-Moon Forum
March 28, 2024, 09:51:34 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: You can go back to the main site here: Kara-Moon site
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Plugin paths, revisited  (Read 2849 times)
sciurius
Sr. Member
****
Posts: 443



« on: August 06, 2019, 12:34:14 PM »

The algorithm to locate plugins has much improved in the 19.* versions of MMA. Still I have a situation I cannot handle satisfactory.

I have some plugins that I want to be available to all my songs.
  • I cannot put them in . or ./plugins, since the current directory will vary depending on the song.
  • I cannot put them in the same directory as the current file being processed, since that will vary as well.
  • I cannot (or rather: I do not want to) put them in the MMA library, since that is system wide and may affect other users.

So I think I need yet another, user settible location, dubbed userPlugPath

    SetUserPlugPath ~/lib/mma

and have MMA look in this folder, and its plugins subfolder.

No default value for userPlugPath so it won't affect existing code and workflow.

What do you think?
Logged
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« Reply #1 on: August 06, 2019, 04:33:43 PM »


Ummm, you say:

  >> I cannot put them in the same directory as the current file being processed, since that will vary as well.

But then say that that can move. Sorry, don't get that. Can't you move the plug along with the file. I _think_ the plugin search in this case is relative to the current dir. Are you trying to do something like: mma ~/foo/bar/mysong.mma? In which case none of this (other than . and plugpath) will work. If I understand, then my suggestion would be to make plugPath a list and let users append to it???
Logged

My online life: http://www.mellowood.ca
sciurius
Sr. Member
****
Posts: 443



« Reply #2 on: August 06, 2019, 05:23:54 PM »

The point is that there is no 'current file' that the plugin belongs to. It belongs to all files.

Consider for example my copyright plugin. I want to apply this to all songs I process, e.g.

    ~/wrk/mma/minorblues.mma
    ~/Music/September/Music/10_Slaap_Zacht/Slaap_Zacht.mma
    ~/Music/September/Music/72_A_Falling_Star/A_Falling_Star.mma
    ~/Music/September/Music/69_The_Matrix/matrix.mma
    ~/Music/Me/Music/49_Hello_Hans/Hello_Hans.mma
    ~/Music/Me/Music/58_Lullaby/lullaby.mma
    ~/Sites/Mandala/mandala.mma


Where must I put the plugin so all these files can use it?
Logged
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« Reply #3 on: August 06, 2019, 06:29:12 PM »

Okay Smiley

So, plugPath is already a list set at start up in paths.py.

Rather than yet another path variable ... would a routine to append your path to plugPath be easier? We'd just need to add setPlugPath() along with the other set* routines and then have the regplug step though that? Then in your song file you just have to a setting like: setPlugPath $PlugPath + mysillypath. Would need a PlugPath macro, which I think is missing.
Logged

My online life: http://www.mellowood.ca
sciurius
Sr. Member
****
Posts: 443



« Reply #4 on: August 06, 2019, 06:59:10 PM »

Yes, that would be great!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.046 seconds with 19 queries.