Exemplo n.º 1
0
 private void InitKeyboard()
 {
     // winamp-style controls
     keyboardActions.Add(Keys.Left, 0, () => { Player?.Skip(-5); });
     keyboardActions.Add(Keys.Right, 0, () => { Player?.Skip(5); });
     //keyboardActions.Add(Key.Z, 0, () => {  });  //TODO: previous in playlist
     keyboardActions.Add(Keys.X, 0, () => { Player?.Play(); });
     keyboardActions.Add(Keys.C, 0, () => { Player?.TogglePause(); });
     keyboardActions.Add(Keys.V, 0, () => { Player?.Stop(); });
     //keyboardActions.Add(Key.B, 0, () => {  });  //TODO: next in playlist
 }
Exemplo n.º 2
0
        public AnalysisDebugRenderer(Font font, Player.Player player)
        {
            projection = Matrix4.CreateOrthographicOffCenter(0f, 1f, 1f, 0f, 0.0f, 10f);  // 0,0 in top left

            float offset    = 1.0f;
            int   drawOrder = 1;

            components.Add(waterfall = new DebugSpectrumWaterfall()
            {
                DrawOrder = drawOrder++, ModelMatrix = GetLayout(0.5f, ref offset), ProjectionMatrix = projection
            });
            components.Add(freqTracker = new BasicShaderHost("debugpeakfreq.glsl|vert", "debugpeakfreq.glsl|frag")
            {
                DrawOrder = drawOrder++, ModelMatrix = GetLayout(0.3f, ref offset), ProjectionMatrix = projection
            });
            components.Add(spectrum = new DebugSpectrum()
            {
                DrawOrder = drawOrder++, ModelMatrix = GetLayout(0.2f, ref offset), ProjectionMatrix = projection
            });
            components.Add(waterfall2 = new DebugSpectrum2()
            {
                DrawOrder = drawOrder++, ModelMatrix = GetLayout(0.2f, ref offset), ProjectionMatrix = projection
            });
            components.Add(datagraphs = new DebugAudioData(font, player.FilterOutputNames)
            {
                DrawOrder = drawOrder++, ModelMatrix = GetLayout(10.0f, ref offset), ProjectionMatrix = projection
            });
            components.Add(keyboardActions = new KeyboardActionManager()
            {
                KeyboardPriority = 100
            }, 1);

            components.Add(parameterEditor = new ParameterEditor(font)
            {
                DrawOrder = drawOrder++
            });

            keyboardActions.Add(Keys.Up, 0, () => { ypostarget += yshift; });
            keyboardActions.Add(Keys.Down, 0, () => { ypostarget -= yshift; });

            //parameterEditor.AddParameter("p1", () => 123.4567f, (f) => { });
            //parameterEditor.AddParameter("p2", () => 0.007f, (f) => { });

            // copy parameters over
            foreach (var p in player.FilterParameters)
            {
                parameterEditor.AddParameter($"{p.Item1}_{p.Item2.Name}", p.Item2.GetValue, p.Item2.SetValue, p.Item2.Delta);
            }
        }
Exemplo n.º 3
0
        private void SetupKeys()
        {
            keys.Clear();

            keys.Add(KeySelectNext, () => { selectedIndex = Math.Min(selectedIndex + 1, entries.Count - 1); UpdateLabels(); });
            keys.Add(KeySelectPrev, () => { selectedIndex = (selectedIndex > 0) ? selectedIndex - 1 : selectedIndex; UpdateLabels(); });

            keys.Add(KeyIncrease, () =>
            {
                Current?.SetValue(Current.GetValue() + Current.Delta);
                UpdateLabels();
            });
            keys.Add(KeySmallIncrease, () =>
            {
                Current?.SetValue(Current.GetValue() + Current.Delta * 0.1f);
                UpdateLabels();
            });
            keys.Add(KeyDecrease, () =>
            {
                Current?.SetValue(Current.GetValue() - Current.Delta);
                UpdateLabels();
            });
            keys.Add(KeySmallDecrease, () =>
            {
                Current?.SetValue(Current.GetValue() - Current.Delta * 0.1f);
                UpdateLabels();
            });
        }