How can I get my material Functions to work into paintable landscape materials?

Hi,
I’m wondering how I can get my material functions to work with the landscape material so that they are paintable on my landscape.
I specifically want it to be materials and not just flat textures.
If anyone knows how to do this could you please point me in the right direction. I’m a bit lost.
Cheers,

Here is an example of my material function setup.
http://puu.sh/o4idd/43236fff6a.jpg
And my landscape material set up so far
http://puu.sh/o4ifv/65ac1deb6c.jpg

You can do it like this:

It does seem like quite a long method so maybe there’s a better way