Ejemplo n.º 1
0
        public BasicPlaySound()
        {
            InitializeComponent();

            Info.Text = AppResources.BasicsPlaySoundInfo;

            sound = Global.Yse.NewSound();
            sound.Create("snare", Global.Yse.ChannelMaster, true);
            sound.Volume = 0.5f;
        }
Ejemplo n.º 2
0
        public PatcherModule()
        {
            if (Global.Yse == null)
            {
                return;
            }

            sound   = Global.Yse.NewSound();
            patcher = Global.Yse.NewPatcher();
            patcher.Create(1);
            sound.Create(patcher);
        }
Ejemplo n.º 3
0
        protected override void OnAppearing()
        {
            base.OnAppearing();
            sound = Global.Yse.NewSound();
            sound.Create("snare", Global.Yse.ChannelMaster, true);
            sound.Volume = 0.5f;

            if (playing)
            {
                sound.Play();
            }
            sound.Volume = (float)VolumeSlider.Value;
            sound.Speed  = (float)SpeedSlider.Value;
        }
Ejemplo n.º 4
0
        public BasicReverb()
        {
            InitializeComponent();
            Info.Text = AppResources.BasicsReverbInfo;

            foreach (string name in stringToPreset.Keys)
            {
                ReverbChoice.Items.Add(name);
            }

            reverb.Active = true;
            Global.Yse.ChannelMaster.AttachReverb();

            snare = Global.Yse.NewSound();
            snare.Create("snare", null, true);
            snare.Play();
        }
Ejemplo n.º 5
0
        public HelpWindow()
        {
            InitializeComponent();

            sound   = Global.YseObj.NewSound();
            patcher = Global.YseObj.NewPatcher();
            patcher.Create(1);

            yap.Handle    = new YapHandler(patcher);
            yap.Focusable = true;
            yap.Focus();
            yap.Init();

            sound.Create(patcher);
            sound.Play();

            Title = "Yap Help";

            string path = "";

#if DEBUG
            path = System.IO.Directory.GetCurrentDirectory();
            DirectoryInfo parent = System.IO.Directory.GetParent(path);
            parent = parent.Parent.Parent.Parent;
            path   = parent.FullName;
            path   = System.IO.Path.Combine(path, "help");
#else
            path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            path = System.IO.Path.Combine(path, "help");
#endif

            if (Directory.Exists(path))
            {
                foreach (string s in Directory.GetDirectories(path))
                {
                    TreeViewItem item = new TreeViewItem();
                    item.Header     = s.Substring(s.LastIndexOf("\\") + 1);
                    item.Tag        = s;
                    item.FontWeight = FontWeights.Normal;
                    item.Items.Add(dummyNode);
                    item.Expanded += new RoutedEventHandler(folderExpanded);
                    helpfiles.Items.Add(item);
                }
            }
        }
Ejemplo n.º 6
0
        public BasicChannels()
        {
            InitializeComponent();

            Info.Text = AppResources.BasicsChannelsInfo;

            ambient = Global.Yse.NewSound();
            ambient.Create("flies", Global.Yse.ChannelAmbient, true);
            ambient.Play();

            music = Global.Yse.NewSound();
            music.Create("my2chords", Global.Yse.ChannelMusic, true);
            music.Play();

            voice = Global.Yse.NewSound();
            voice.Create("countdown", Global.Yse.ChannelVoice, true);
            voice.Play();
        }
Ejemplo n.º 7
0
        public Basic3D()
        {
            InitializeComponent();

            Info.Text = AppResources.Basics3DInfo;

            listenerPos.Set(0f, 0f, 0f);
            Global.Yse.Listener.Pos(listenerPos / 10f);

            sound1.Create("contact", null, true);
            sound1Pos.Set(-100f, 30f, 0f);
            sound1.SetPos(sound1Pos / 10f);
            sound1.Play();

            sound2.Create("drone", null, true);
            sound2Pos.Set(100f, -10f, 0f);
            sound2.SetPos(sound2Pos / 10f);
            sound2.Play();
        }
Ejemplo n.º 8
0
        public SoundControl(JObject obj, OscTree.Tree oscParent, string soundPath, SoundGrid parentGrid)
        {
            InitializeComponent();

            originalFileName = obj.ContainsKey("OriginalFileName") ? (string)obj["OriginalFileName"] : String.Empty;
            projectFileName  = obj.ContainsKey("ProjectFileName") ? (string)obj["ProjectFileName"] : String.Empty;
            id              = obj.ContainsKey("ID") ? (string)obj["ID"] : String.Empty;
            soundName       = obj.ContainsKey("Name") ? (string)obj["Name"] : string.Empty;
            Loop            = obj.ContainsKey("Loop") ? (bool)obj["Loop"] : false;
            this.parentGrid = parentGrid;


            this.DataContext = this;

            if (projectFileName != string.Empty)
            {
                sound = Yse.Yse.Handle.Interface.NewSound();

                var path = System.IO.Path.Combine(soundPath, projectFileName);
                sound.Create(path, null, false, 1, true);
                sound.Doppler          = false;
                PositionSlider.Minimum = 0;
                PositionSlider.Maximum = sound.Length;
            }

            osc = new OscTree.Object(new OscTree.Address(soundName, id), typeof(float));
            oscParent.Add(osc);
            osc.Endpoints.Add(new OscTree.Endpoint("Play", (args) =>
            {
                if (sound == null)
                {
                    return;
                }

                if (args.Count() > 0)
                {
                    try
                    {
                        if (Convert.ToBoolean(args[0]) == true)
                        {
                            sound.Play();
                        }
                        else
                        {
                            sound.Stop();
                        }
                    }
                    catch (Exception)
                    {
                        sound.Play();
                    }
                }
                else
                {
                    sound.Play();
                }
            }, typeof(bool)));

            osc.Endpoints.Add(new OscTree.Endpoint("Restart", (args) =>
            {
                if (sound == null)
                {
                    return;
                }
                if (sound.Playing)
                {
                    sound.Time = 0;
                }
                else
                {
                    sound.Play();
                }
            }));

            osc.Endpoints.Add(new OscTree.Endpoint("Stop", (args) =>
            {
                if (sound == null)
                {
                    return;
                }
                sound.Stop();
            }, typeof(bool)));

            osc.Endpoints.Add(new OscTree.Endpoint("Pause", (args) =>
            {
                if (sound == null)
                {
                    return;
                }
                sound.Pause();
            }, typeof(bool)));

            osc.Endpoints.Add(new OscTree.Endpoint("Time", (args) =>
            {
                if (sound == null)
                {
                    return;
                }

                if (args.Count() > 0)
                {
                    sound.Time = Convert.ToSingle(args[0]);
                }
            }, typeof(float)));

            osc.Endpoints.Add(new OscTree.Endpoint("Volume", (args) =>
            {
                if (sound == null)
                {
                    return;
                }
                if (args.Count() > 0)
                {
                    sound.Volume = Convert.ToSingle(args[0]);
                }
            }, typeof(float)));

            osc.Endpoints.Add(new OscTree.Endpoint("Speed", (args) =>
            {
                if (sound == null)
                {
                    return;
                }
                if (args.Count() > 0)
                {
                    sound.Speed = Convert.ToSingle(args[0]);
                }
            }, typeof(float)));

            osc.Endpoints.Add(new OscTree.Endpoint("Loop", (args) =>
            {
                if (sound == null)
                {
                    return;
                }
                if (args.Count() > 0)
                {
                    sound.Loop = Convert.ToBoolean(args[0]);
                }
            }, typeof(bool)));

            osc.Endpoints.Add(new OscTree.Endpoint("Pos", (args) =>
            {
                if (sound == null)
                {
                    return;
                }
                try
                {
                    IYse.Pos pos = new IYse.Pos();
                    if (args.Count() > 1)
                    {
                        pos.X = Convert.ToSingle(args[0]) * 10;
                        pos.Z = Convert.ToSingle(args[1]) * 10;
                    }
                    sound.SetPos(pos);
                }
                catch (Exception) { }
            }, typeof(object)));
        }