예제 #1
0
        /// <summary>
        /// returns the set in html format
        /// </summary>
        /// <returns></returns>
        public string getHtml(DisplayAndPrintSettings settings, bool noCapo = false, bool preferFlats = false)
        {
            var setClone = this.Clone();

            for (int i = 0; i < setClone.songList.Count; i++)
            {
                var songClone = setClone.songList[i].Clone();

                // force flats to show
                if (preferFlats)
                {
                    songClone.capoUp();
                    songClone.capoDown(preferFlats);
                }

                // Sometimes we want to capo removed from the song (e.g. for the bass guitarist or pianst)
                if (noCapo && songClone.Capo > 0)
                {
                    while (songClone.Capo > 0)
                    {
                        songClone.capoDown(preferFlats);
                    }
                }
                setClone.songList[i] = songClone;
            }


            Export.ExportToHtml htmlExporter = new Export.ExportToHtml(setClone, settings);
            var result = htmlExporter.GenerateHtml();

            return(result);
        }
예제 #2
0
        public static DisplayAndPrintSettings loadSettings(DisplayAndPrintSettingsType settingsType)
        {
            DisplayAndPrintSettings settings = new DisplayAndPrintSettings();

            if (settingsType == DisplayAndPrintSettingsType.DisplaySettings)
            {
                settings = XmlReaderWriter.readSettings(Settings.GlobalApplicationSettings.DisplaySettingsFileName);
                if (settings == null)
                {
                    settings = new DisplayAndPrintSettings(DisplayAndPrintSettingsType.DisplaySettings);
                }
                settings.SettingsFilePath = Settings.GlobalApplicationSettings.DisplaySettingsFileName;
            }
            else if (settingsType == DisplayAndPrintSettingsType.PrintSettings)
            {
                settings = XmlReaderWriter.readSettings(Settings.GlobalApplicationSettings.PrintSettingsFilename);
                if (settings == null)
                {
                    settings = new DisplayAndPrintSettings(DisplayAndPrintSettingsType.PrintSettings);
                }
                settings.SettingsFilePath = Settings.GlobalApplicationSettings.PrintSettingsFilename;
            }
            else if (settingsType == DisplayAndPrintSettingsType.TabletSettings)
            {
                settings = XmlReaderWriter.readSettings(Settings.GlobalApplicationSettings.TabletSettingsFilename);
                if (settings == null)
                {
                    settings = new DisplayAndPrintSettings(DisplayAndPrintSettingsType.TabletSettings);
                }
                settings.SettingsFilePath = Settings.GlobalApplicationSettings.TabletSettingsFilename;
            }

            return(settings);
        }
예제 #3
0
        /// <summary>
        /// returns the set in html format
        /// </summary>
        /// <returns></returns>
        public string getHtml(DisplayAndPrintSettings settings)
        {
            Export.ExportToHtml htmlExporter = new Export.ExportToHtml(this, settings);
            var result = htmlExporter.GenerateHtml();

            return(result);
        }
예제 #4
0
        /// <summary>
        /// returns the song in html format
        /// </summary>
        /// <returns></returns>
        public string getHtml(DisplayAndPrintSettings settings, bool enableAutoRefresh = false, bool noCapo = false, bool preferFlats = false)
        {
            var songClone = (Song)this.MemberwiseClone();

            // force flats to show
            if (preferFlats)
            {
                songClone.capoUp();
                songClone.capoDown(preferFlats);
            }

            // Sometimes we want to capo removed from the song (e.g. for the bass guitarist or pianst)
            if (noCapo && songClone.Capo > 0)
            {
                while (songClone.Capo > 0)
                {
                    songClone.capoDown(preferFlats);
                }
            }

            Export.ExportToHtml htmlExporter = new Export.ExportToHtml(songClone, settings);
            var result = htmlExporter.GenerateHtml(enableAutoRefresh);

            return(result);
        }
예제 #5
0
        /// <summary>
        /// returns the song in html format
        /// </summary>
        /// <returns></returns>
        public string getHtml(DisplayAndPrintSettings settings, bool enableAutoRefresh = false)
        {
            Export.ExportToHtml htmlExporter = new Export.ExportToHtml(this, settings);
            var result = htmlExporter.GenerateHtml(enableAutoRefresh);

            return(result);
        }
예제 #6
0
        //load settings file from indicated path
        public static DisplayAndPrintSettings loadSettings(DisplayAndPrintSettingsType settingsType, string path)
        {
            var settings = XmlReaderWriter.readSettings(path);

            if (settings == null)
            {
                settings = new DisplayAndPrintSettings(settingsType, path);
            }
            settings.SettingsFilePath = path;
            settings.settingsType     = settingsType;
            return(settings);
        }
예제 #7
0
        public string ExportToHtml(DisplayAndPrintSettings settings)
        {
            Export.ExportToHtml htmlExporter = new Export.ExportToHtml(this, settings);
            string htmlText = htmlExporter.GenerateHtml();
            string folder   = null;

            if (settings.settingsType == DisplayAndPrintSettingsType.TabletSettings)
            {
                folder = Settings.GlobalApplicationSettings.TabletFolder;
            }
            else
            {
                folder = Settings.GlobalApplicationSettings.PrintFolder;
            }
            string destination = String.Format("{0}/{1}.html", folder, this.setName);

            File.WriteAllText(destination, htmlText);
            return(destination);
        }
예제 #8
0
        public string ExportToHtml(DisplayAndPrintSettings settings)
        {
            Export.ExportToHtml htmlExporter = new Export.ExportToHtml(this, settings);
            string htmlText = htmlExporter.GenerateHtml();
            string folder   = null;

            if (settings.settingsType == DisplayAndPrintSettingsType.TabletSettings)
            {
                folder = Path.Combine(Settings.GlobalApplicationSettings.TabletFolder, SongSubFolder);
            }
            else
            {
                folder = Path.Combine(Settings.GlobalApplicationSettings.PrintFolder, SongSubFolder);
            }
            string destination = String.Format("{0}/{1}.html", folder, this.generateShortTitle());

            new FileInfo(destination).Directory.Create();
            File.WriteAllText(destination, htmlText);
            return(destination);
        }