本文整理汇总了C++中Mixer::SetFxChannels方法的典型用法代码示例。如果您正苦于以下问题:C++ Mixer::SetFxChannels方法的具体用法?C++ Mixer::SetFxChannels怎么用?C++ Mixer::SetFxChannels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mixer
的用法示例。
在下文中一共展示了Mixer::SetFxChannels方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
#if defined(USE_MSXML)
CoInitialize(0);
#endif
const char *fname = "data.xml";
if (argc > 1)
fname = argv[1];
InitSynthesizer();
mix.SetChannels(2);
mix.MasterVolume(1.0, 1.0);
mix.ChannelOn(0, 1);
mix.ChannelOn(1, 1);
mix.ChannelVolume(0, 1.0);
mix.ChannelVolume(1, 1.0);
#ifdef ADD_REVERB
mix.SetFxChannels(1);
mix.FxInit(0, &rvrb, 0.1);
mix.FxLevel(0, 0, 0.2);
mix.FxLevel(0, 1, 0.2);
rvrb.InitReverb(1.0, 2.0);
#endif
inMgr.Init(&mix, &wvf);
inMgr.AddType("Tone", ToneInstr::ToneFactory, ToneInstr::ToneEventFactory);
inMgr.AddType("ToneFM", ToneFM::ToneFMFactory, ToneFM::ToneFMEventFactory);
inMgr.AddType("AddSynth", AddSynth::AddSynthFactory, AddSynth::AddSynthEventFactory);
inMgr.AddType("SubSynth", SubSynth::SubSynthFactory, SubSynth::SubSynthEventFactory);
inMgr.AddType("FMSynth", FMSynth::FMSynthFactory, FMSynth::FMSynthEventFactory);
inMgr.AddType("MatrixSynth", MatrixSynth::MatrixSynthFactory, MatrixSynth::MatrixSynthEventFactory);
inMgr.AddType("WFSynth", WFSynth::WFSynthFactory, WFSynth::WFSynthEventFactory);
inMgr.AddType("Chuffer", Chuffer::ChufferFactory, Chuffer::ChufferEventFactory);
inMgr.AddType("ModSynth", ModSynth::ModSynthFactory, ModSynth::ModSynthEventFactory);
inMgr.AddType("BuzzSynth", BuzzSynth::InstrFactory, BuzzSynth::EventFactory);
InstrMapEntry *ime = 0;
while ((ime = inMgr.EnumType(ime)) != 0)
ime->dumpTmplt = DestroyTemplate;
XmlSynthDoc doc;
XmlSynthElem rootNode(&doc);
if (!doc.Open(fname, &rootNode))
{
printf("Cannot open file %s\n", fname);
exit(1);
}
// Optional: use LoadInstrLib(inMgr, fname)
// but we want to discover the inum values
// and add sequences programaticaly...
XmlSynthElem elem(&doc);
XmlSynthElem *inst = rootNode.FirstChild(&elem);
while (inst != NULL)
{
if (inst->TagMatch("instr"))
{
InstrConfig *ent = inMgr.LoadInstr(inst);
if (strcmp(ent->instrType->GetType(), "WFSynth") == 0)
AddEvent(ent->inum, 48, 1.0);
else
AddSequence(ent->inum, 0.25);
}
inst = elem.NextSibling(&elem);
}
doc.Close();
if (wvf.OpenWaveFile("example10.wav", 2))
{
printf("Cannot open wavefile for output\n");
exit(1);
}
seq.Sequence(inMgr);
#ifdef ADD_REVERB
// drain the reverb...
AmpValue lv;
AmpValue rv;
long n = synthParams.isampleRate;
while (n-- > 0)
{
mix.Out(&lv, &rv);
wvf.Output2(lv, rv);
}
#endif
wvf.CloseWaveFile();
///////////////////////////////////////////////////////////////
// Code to test instrument save functions...
#define TEST_SAVE_INSTR 1
#ifdef TEST_SAVE_INSTR
doc.NewDoc("instrlib", &rootNode);
InstrConfig *inc = inMgr.EnumInstr(0);
while (inc)
{
//.........这里部分代码省略.........