Esempio n. 1
0
        public override void OnEnabled()
        {
            base.OnEnabled();

            Directory.CreateDirectory(Path.Combine(GameService.FileSrv.BasePath, "musician"));

            xmlParser       = new XmlMusicSheetReader();
            displayedSheets = new List <SheetButton>();
            MusicianTab     = GameService.Director.BlishHudWindow.AddTab("Musician", ICON, BuildHomePanel(GameService.Director.BlishHudWindow), 0);
        }
Esempio n. 2
0
        private static MusicPlayer MusicBoxNotationMusicPlayerFactory(ApplicationOptions filePath)
        {
            var rawMusicSheet = new XmlMusicSheetReader().LoadFromFile(filePath.File);

            var musicSheet = new MusicSheetParser(new ChordParser(new NoteParser())).Parse(
                rawMusicSheet.Melody,
                int.Parse(rawMusicSheet.Tempo),
                int.Parse(rawMusicSheet.Meter.Split('/')[0]),
                int.Parse(rawMusicSheet.Meter.Split('/')[1]));

            var algorithm = rawMusicSheet.Algorithm == "favor notes"
                ? new FavorNotesAlgorithm() : (IPlayAlgorithm) new FavorChordsAlgorithm();

            return(new MusicPlayer(
                       musicSheet,
                       new Harp(GetKeyboard(filePath)),
                       algorithm));
        }
Esempio n. 3
0
 protected override void Initialize()
 {
     ICON     = ICON ?? ContentsManager.GetTexture("musician_icon.png");
     Conveyor = new Conveyor()
     {
         Parent = ContentService.Graphics.SpriteScreen, Visible = false
     };
     xmlParser       = new XmlMusicSheetReader();
     displayedSheets = new List <SheetButton>();
     StopButton      = new HealthPoolButton()
     {
         Parent  = GameService.Graphics.SpriteScreen,
         Text    = "Stop Playback",
         ZIndex  = -1,
         Visible = false
     };
     StopButton.LeftMouseButtonReleased += delegate
     {
         this.StopPlayback();
     };
     GameService.GameIntegration.Gw2LostFocus += GameIntegrationOnGw2LostFocus;
 }