public override void Init()
    {
        string myObject;

        myObject = ObjectPrivate.ObjectId.ToString();
        Wait(TimeSpan.FromSeconds(5.0));

        SendBlockNamescfg sendBlockscfg = new SendBlockNamescfg();

        sendBlockscfg.BlockNameArraycfg = new List <string>();
        //BeatBlockName = Sample1.GetName();
        sendBlockscfg.BlockNameArraycfg.Add(BeatBlockName);
        sendBlockscfg.BlockNameArraycfg.Add(beats);
        sendBlockscfg.BlockNameArraycfg.Add(BlockGenre);
        string BeatBlockConfigEvent = "BeatBlockConfig" + myObject;

        PostScriptEvent(ScriptId.AllScripts, BeatBlockConfigEvent, sendBlockscfg);

        SendSamplescfg sendSamplescfg = new SendSamplescfg();

        sendSamplescfg.SampleLibrarycfg = new List <SoundResource>();
        if (Sample1 != null)
        {
            sendSamplescfg.SampleLibrarycfg.Add(Sample1);
        }
        string BeatBlockSampleConfigEvent = "BeatBlockSampleConfig" + myObject;

        PostScriptEvent(ScriptId.AllScripts, BeatBlockSampleConfigEvent, sendSamplescfg);
    }
Пример #2
0
    private void getSamplescfg(ScriptEventData gotSamplescfg)
    {
        if (gotSamplescfg.Data == null)
        {
            Log.Write(LogLevel.Warning, Script.ID.ToString(), "Expected non-null event data");
            return;
        }
        SendSamplescfg sendSamplescfg = gotSamplescfg.Data.AsInterface <SendSamplescfg>();

        if (sendSamplescfg == null)
        {
            Log.Write(LogLevel.Error, Script.ID.ToString(), "Unable to create interface, check logs for missing member(s)");
            return;
        }
        //Log.Write("Raver: Sample Count: " + sendSamplescfg.SendSampleLibrarycfg.Count());
        Sample1 = sendSamplescfg.SendSampleLibrarycfg.ElementAt(0);
        BeatBlockSampleConfigSub.Unsubscribe();
    }