コード例 #1
0
 private void UpdatePerformance()
 {
     if (Conductor.IsConducting)
     {
         // Someone is controlling you, disable stuff
         Playlist.Visible  = false;
         Conductor.Visible = true;
     }
     else
     {
         Playlist.Visible  = true;
         Conductor.Visible = false;
     }
     if (Player.Status == PlayerStatus.Conducting)
     {
         Player.Interactable          = true;
         Player.Keyboard.OverrideText = "Conducting in progress.";
         Player.Keyboard.Enabled      = false;
     }
     else if (!Program.programOptions.DisableMemory)
     {
         Player.Interactable          = FFXIV.IsPerformanceReady();
         Player.Keyboard.OverrideText = FFXIV.IsPerformanceReady() ? string.Empty : "Open Bard Performance mode to play.";
         Player.Keyboard.Enabled      = true;
     }
 }
コード例 #2
0
ファイル: BmpMain.cs プロジェクト: nolnoch/bardmusicplayer
        // OnMidiVoice + OffMidiVoice is called with correct octave shift
        private void OnMidiVoice(Object o, NoteEvent onNote)
        {
            Statistics.AddNoteCount();

            if (Properties.Settings.Default.Verbose)
            {
                FFXIVKeybindDat.Keybind thiskeybind = FFXIV.hotkeys.GetKeybindFromNoteByte(onNote.note);
                if (thiskeybind == null)
                {
                    string ns = FFXIVKeybindDat.RawNoteByteToPianoKey(onNote.note);
                    if (!string.IsNullOrEmpty(ns))
                    {
                        string str = string.Format("Note {0} is out of range, it will not be played.", ns);
                        this.LogMidi(str);
                    }
                }
            }

            if (LocalOrchestra.OrchestraEnabled)
            {
                return;
            }

            if (Player.Status == PlayerStatus.Conducting)
            {
                return;
            }
            if (!FFXIV.IsPerformanceReady())
            {
                return;
            }
            if (onNote.track != null)
            {
                // If from midi file
                if (onNote.track != Player.Player.LoadedTrack)
                {
                    return;
                }
            }
            if (Sharlayan.Reader.CanGetChatInput())
            {
                if (FFXIV.memory.ChatInputOpen)
                {
                    return;
                }
            }

            if (FFXIV.hotkeys.GetKeybindFromNoteByte(onNote.note) is FFXIVKeybindDat.Keybind keybind)
            {
                if (WantsHold)
                {
                    FFXIV.hook.SendKeybindDown(keybind);
                }
                else
                {
                    FFXIV.hook.SendAsyncKeybind(keybind);
                }
            }
        }
コード例 #3
0
ファイル: BmpMain.cs プロジェクト: nolnoch/bardmusicplayer
 private void Hook_OnKeyPressed(Object o, Keys key)
 {
     if (Properties.Settings.Default.ForcedOpen)
     {
         return;
     }
     if (FFXIV.IsPerformanceReady() && !FFXIV.memory.ChatInputOpen)
     {
         if (key == Keys.F10)
         {
             foreach (FFXIVKeybindDat.Keybind keybind in FFXIV.hotkeys.GetPerformanceKeybinds())
             {
                 FFXIV.hook.SendAsyncKey(keybind.GetKey());
                 System.Threading.Thread.Sleep(100);
             }
         }
         if (key == Keys.Space)
         {
             if (Player.Player.IsPlaying)
             {
                 Player.Player.Pause();
             }
             else
             {
                 Player.Player.Play();
             }
         }
         if (key == Keys.Right)
         {
             if (Player.Player.IsPlaying)
             {
                 Player.Player.Seek(1000);
             }
         }
         if (key == Keys.Left)
         {
             if (Player.Player.IsPlaying)
             {
                 Player.Player.Seek(-1000);
             }
         }
         if (key == Keys.Up)
         {
             if (Player.Player.IsPlaying)
             {
                 Player.Player.Seek(10000);
             }
         }
         if (key == Keys.Down)
         {
             if (Player.Player.IsPlaying)
             {
                 Player.Player.Seek(-10000);
             }
         }
     }
 }
コード例 #4
0
ファイル: BmpMain.cs プロジェクト: nolnoch/bardmusicplayer
 private void UpdatePerformance()
 {
     if (Player.Status == PlayerStatus.Conducting)
     {
         Player.Interactable          = true;
         Player.Keyboard.OverrideText = "Conducting in progress.";
         Player.Keyboard.Enabled      = false;
     }
     else if (!Program.programOptions.DisableMemory)
     {
         Player.Interactable          = FFXIV.IsPerformanceReady();
         Player.Keyboard.OverrideText = FFXIV.IsPerformanceReady() ? string.Empty : "Open Bard Performance mode to play.";
         Player.Keyboard.Enabled      = true;
     }
 }
コード例 #5
0
        private bool ChatCommandSeek(BmpChatListener.Command cmd)
        {
            if (IsCommandPermitted(cmd))
            {
                if (int.TryParse(cmd.param, out int delay))
                {
                    delay = delay.Clamp(-500, 500);

                    if (FFXIV.IsPerformanceReady() && Player.Player.IsPlaying)
                    {
                        Player.Player.Seek(delay);
                    }
                }
            }
            return(true);
        }
コード例 #6
0
        private void OffMidiVoice(Object o, NoteEvent offNote)
        {
            if (LocalOrchestra.OrchestraEnabled)
            {
                LocalOrchestra.ProcessOffNote(offNote);
                return;
            }

            if (Player.Status == PlayerStatus.Conducting)
            {
                return;
            }

            if (!FFXIV.IsPerformanceReady())
            {
                return;
            }

            if (offNote.track != null)
            {
                if (offNote.track != Player.Player.LoadedTrack)
                {
                    return;
                }
            }

            if (WantsSlow)
            {
                return;
            }

            if (!FFXIV.memory.ChatInputOpen)
            {
                if (WantsHold)
                {
                    if (FFXIV.hotkeys.GetKeybindFromNoteByte(offNote.note) is FFXIVKeybindDat.Keybind keybind)
                    {
                        FFXIV.hook.SendKeybindUp(keybind);
                    }
                    chordNotes.OffKey(offNote);
                }
            }
        }
コード例 #7
0
        // OnMidiVoice + OffMidiVoice is called with correct octave shift
        private void OnMidiVoice(Object o, NoteEvent onNote)
        {
            Statistics.AddNoteCount();

            if (Properties.Settings.Default.Verbose)
            {
                FFXIVKeybindDat.Keybind keybind = FFXIV.hotkeys.GetKeybindFromNoteByte(onNote.note);
                if (keybind == null)
                {
                    string ns = FFXIVKeybindDat.RawNoteByteToPianoKey(onNote.note);
                    if (!string.IsNullOrEmpty(ns))
                    {
                        string str = string.Format("Note {0} is out of range, it will not be played.", ns);
                        ChatLogAll.AppendRtf(BmpChatParser.FormatRtf(str, "\\red255\\green200\\blue200"));
                    }
                }
            }

            if (LocalOrchestra.OrchestraEnabled)
            {
                LocalOrchestra.ProcessOnNote(onNote);
                return;
            }

            if (Player.Status == PlayerStatus.Conducting)
            {
                return;
            }
            if (!Player.Player.IsPlaying)
            {
                return;
            }
            if (!FFXIV.IsPerformanceReady())
            {
                return;
            }
            if (onNote.track != null)
            {
                // If from midi file
                if (onNote.track != Player.Player.LoadedTrack)
                {
                    return;
                }
            }
            if (!FFXIV.memory.ChatInputOpen)
            {
                if (WantsSlow)
                {
                    if (FFXIV.hotkeys.GetKeybindFromNoteByte(onNote.note) is FFXIVKeybindDat.Keybind keybind)
                    {
                        int delay = Decimal.ToInt32(Properties.Settings.Default.PlayHold);
                        // Slow play

                        Player.Player.InternalClock.Stop();
                        FFXIV.hook.SendSyncKey(keybind.GetKey(), true, true, false);

                        //Bmp.Player.InternalClock.Sleep(delay);
                        Thread.Sleep(delay);

                        FFXIV.hook.SendSyncKey(keybind.GetKey(), true, false, true);
                        Player.Player.InternalClock.Continue();

                        return;
                    }
                }
                if (Properties.Settings.Default.AutoArpeggiate)
                {
                    if (chordNotes.OnKey(onNote))
                    {
                        // Chord detected and queued
                        Console.WriteLine("Delay " + onNote + " by 100ms");
                    }
                }
                if (!chordNotes.HasTimer(onNote))
                {
                    if (FFXIV.hotkeys.GetKeybindFromNoteByte(onNote.note) is FFXIVKeybindDat.Keybind keybind)
                    {
                        if (WantsHold)
                        {
                            FFXIV.hook.SendKeybindDown(keybind);
                        }
                        else
                        {
                            FFXIV.hook.SendAsyncKeybind(keybind);
                        }
                    }
                }
            }
        }