Accessing Tracktion default directory X-Platform

Hey jules…

how would one get the default tracktion directory via jule? any clues? I’ve got a colorscheme reader for this little tool, and I’d like it to know where to get the default scheme automatically.

w00t! :slight_smile:

But the colour schemes are all munged into the executable - you can’t read them externally…? Or have I misunderstood what you’re doing?

have you forgotten how it’s done jules? :smiley: the current colourscheme settings are stored in the .trksettings file :smiley:

oh those colourschemes!

Well if it’s in the tracktion app directory, I don’t think there’s any easy way of finding that without doing horrible registry stuff. You’d have to look up the registry entries that say which app to start for a tracktion file extension. Ugh.

you can always ask the user to select the folder

okee… thanks… looks like I’ll have to let the user select.

i’d presume the plug to be in the tracktion2\plugins folder, therefore it should be able to access the .trksettings file from the parent folder. if it’s not found there, then it could ask the user to specify the location. perhaps it could even check the parent of the parent just in case? i don’t know how the mac directories are structured tho, but i don’t see it too much of a porting issue to change a single path checking function :slight_smile:

here is how I resolved it with no registry hacking…

tracktionPath = File::getCurrentApplicationFile().getFullPathName();
tracktionPath = tracktionPath.dropLastCharacters(13);
tracktionPath.append( T("CurrentUserSettings.trksettings"),32);

HaX0rz! hahah :smiley:

ingenious! :smiley: well done mod

oh, Mod, please - that’s grotesque! Let’s set a good example to any newbie programmers who may be reading this, by using

File::getCurrentApplicationFile().getParentDirectory().getSiblingFile (T(“CurrentUserSettings.trksettings”))

instead!

Golden rule: never manipulate filenames as strings!

even better! :smiley: :smiley: :smiley:

i can see that’s a much better way of doing it. i presume it’s a golden rule tho to ensure that any path structures are definite? otherwise they’re just scattered characters waiting to be reparsed with chance for being wrong somewhere along the line…

constantly learning stuff from this ‘jules’ fella :hihi:

[quote=“jules”]oh, Mod, please - that’s grotesque! Let’s set a good example to any newbie programmers who may be reading this, by using

File::getCurrentApplicationFile().getParentDirectory().getSiblingFile (T(“CurrentUserSettings.trksettings”))

instead!

Golden rule: never manipulate filenames as strings![/quote]

well that all you had to say in the first place! sheesh! I thought getsibling() might force my brother to drive down to my way… didin’t want to inconvenice him at such a late hour. :lol: thanks for the tip jules, you know how much I love horrid code. :shock: I’ll go sit in the corner now with a bar of soap in my mouth for all the dirty talk. :lol:

wait… now what about on the mac? or is it pretty safe to assume everything goes in ($HOME)/Library/Cache/Tracktion?

glad you’re taking your criticism like a man!

yes, the mac’s a bit different, I think it’s pretty safe to assumes it’s in the library/cache folder. You can use File (T(“~/Library/Cache/Tracktion”)) to get the folder - juce will parse the ~ properly.

you know what really sucks… I’ve started spelling color, colour… bastard! :wink:

Jules! World domination gets ever closer! :hihi:

Colour is the way it REALLY is. spell it like a MAN!

re Color/Colour

When I was in first year I handed in a Java coursework that was perfection. Apart from a comment about why I should not be spelling “Colour” like “Color” in my comments just because Java/America does! Nit-picking cunts.