Previous: Writing your own MarSystems, Up: Compiling and using a new MarSystem

10.1.2 Using your MarSystem

Suppose that you have created a MarSystem called MyMar, which implements a filter. To use this MarSystem in a network (see Writing applications), simply register the MarSystem with the manager:

     MarSystemManager mng;
     // add MyMar to MarSystemManager
     MarSystem* myMar = new MyMar("hello");
     mng.registerPrototype("MyMar", myMar);
     // create a network normally
     playbacknet = mng.create("Series", "playbacknet");
     playbacknet->addMarSystem(mng.create("SoundFileSource", "src"));
     playbacknet->addMarSystem(mng.create("MyMar", "mymar"));
     playbacknet->addMarSystem(mng.create("Gain", "gain"));
     playbacknet->addMarSystem(mng.create("AudioSink", "dest"));
     playbacknet->updctrl("AudioSink/dest/mrs_bool/initAudio", true);