Exemplo n.º 1
0
 public TableListEntry(ITable table, string description, bool allowPaste, string statusText, TuningMode tuningMode)
 {
     Description = description;
     Table       = table;
     AllowPaste  = allowPaste;
     StatusText  = statusText;
     TuningMode  = tuningMode;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a tuning
        /// </summary>
        /// <param name="mode">Tuning mode of the tuning</param>
        public Tuning(TuningMode mode)
        {
            _mode = mode;

            switch (mode)
            {
                case TuningMode.StandardTuning:
                case TuningMode.StandardTuning_6String:
                    _tuning = new String[] { "e", "a", "d", "g", "b", "e" };
                    break;
                case TuningMode.ATuning_6String:
                    _tuning = new String[] { "a", "d", "g", "c", "e", "a" };
                    break;
                case TuningMode.BTuning_6String:
                    _tuning = new String[] { "b", "e", "a", "d", "f#", "b" };
                    break;
                case TuningMode.CTuning_6String:
                    _tuning = new String[] { "c", "f", "a#", "d#", "g", "c" };
                    break;
                case TuningMode.DTuning_6String:
                    _tuning = new String[] { "d", "g", "c", "f", "a", "d" };
                    break;
                case TuningMode.DropATuning_6String:
                    _tuning = new String[] { "a", "e", "a", "d", "f#", "b" };
                    break;
                case TuningMode.DropDTuning_6String:
                    _tuning = new String[] { "d", "a", "d", "g", "b", "e" };
                    break;
                case TuningMode.DropCTuning_6String:
                    _tuning = new String[] { "c", "g", "c", "f", "a", "d" };
                    break;
                case TuningMode.StandardTuning_7String:
                    _tuning = new String[] { "b", "e", "a", "d", "g", "b", "e" };
                    break;
                case TuningMode.ATuning_7String:
                    _tuning = new String[] { "a", "d", "g", "c", "f", "a", "d" };
                    break;
                case TuningMode.CTuning_7String:
                    _tuning = new String[] { "c", "f", "a#", "d#", "g#", "c", "f" };
                    break;
                case TuningMode.CSharpTuning_7String:
                    _tuning = new String[] { "a#", "d#", "g#", "c#", "f#", "a#", "d#" };
                    break;
                case TuningMode.DTuning_7String:
                    _tuning = new String[] { "d", "g", "c", "f", "a#", "d", "g" };
                    break;
                case TuningMode.DropATuning_7String:
                    _tuning = new String[] { "a", "e", "a", "d", "f#", "b", "e" };
                    break;
                case TuningMode.DropGTuning_7String:
                    _tuning = new String[] { "g", "d", "g", "c", "f", "a", "d" };
                    break;
                case TuningMode.DropGSharpTuning_7String:
                    _tuning = new String[] { "g#", "d#", "g#", "c#", "f#", "a#", "d#" };
                    break;
                case TuningMode.DropFSharpTuning_7String:
                    _tuning = new String[] { "f#", "c#", "f#", "b", "e", "g#", "c#" };
                    break;
                case TuningMode.StandardTuning_8String:
                    _tuning = new String[] { "f#", "b", "e", "a", "d", "g", "b", "e" };
                    break;
                case TuningMode.ATuning_8String:
                    _tuning = new String[] { "a", "d", "g", "c", "f", "a", "d", "g" };
                    break;
                case TuningMode.FTuning_8String:
                    _tuning = new String[] { "fь", "bь", "eь", "aь", "dь", "gь", "bь", "eь" };
                    break;
                case TuningMode.DropDSharpTuning_8String:
                    _tuning = new String[] { "eь", "bь", "eь", "aь", "dь", "gь", "bь", "eь" };
                    break;
                case TuningMode.DropETuning_8String:
                    _tuning = new String[] { "e", "b", "e", "a", "d", "g", "b", "e" };
                    break;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Prints a list of chords
        /// </summary>
        /// <param name="chords">List of chords</param>
        /// <param name="mode">Tuning mode</param>
        /// <param name="maxChordsInLine">Maximum number of chords in a single line</param>
        /// <returns>String representation of the list of chords</returns>
        public static String PrintChords(List<Chord> chords, TuningMode mode,int maxChordsInLine)
        {
            Tuning _tuning = new Tuning(mode);
            int _nStrings = _tuning.Length;

            StringBuilder retVal = new StringBuilder();
            SortedDictionary<int, StringBuilder> _stringText = new SortedDictionary<int, StringBuilder>();

            bool nextLine = true;
            int chordCount = 0;
            while (nextLine)
            {
                nextLine = false;
                _stringText.Clear();

                if (chords.Count == chordCount)
                {
                    nextLine = false;
                }
                else
                {
                    //get longest string length
                    int maxStringWidth = Tuning.GetLongestStringLength(_tuning);

                    //init strings
                    for (int i = 1; i <= _nStrings; i++)
                    {
                        _stringText.Add(i, new StringBuilder(_tuning[i - 1].ToUpper().PadLeft(maxStringWidth, ' ') + "["));
                    }

                    //add flags stringbuilder
                    _stringText.Add(-1, new StringBuilder("".PadLeft(maxStringWidth + 1, ' ')));

                    Chord currentChord = null;
                    String toPrint = "";
                    int counter = 1;
                    for (int i = chordCount; i < chords.Count && !nextLine; i++)
                    {
                        currentChord = chords[i];

                        //process chord
                        for (int j = 0; j < currentChord.Strings.Length; j++)
                        {
                            if (currentChord.Strings[j] == SpecialStrings.Pull)
                            {
                                toPrint = "p---";
                            }
                            else if (currentChord.Strings[j] == SpecialStrings.HammerDown)
                            {
                                toPrint = "h---";
                            }
                            else if (currentChord.Strings[j] == SpecialStrings.SlideUp)
                            {
                                toPrint = "/---";
                            }
                            else if (currentChord.Strings[j] == SpecialStrings.SlideDown)
                            {
                                toPrint = "\\---";
                            }
                            else if (currentChord.Strings[j] == SpecialStrings.NotPlayed)
                            {
                                toPrint = "---x";
                            }
                            else if (currentChord.Strings[j] == SpecialStrings.FullBend)
                            {
                                toPrint = "b---";
                            }
                            else if (currentChord.Strings[j] == SpecialStrings.HalfBend)
                            {
                                toPrint = "b|2--";
                            }
                            else if (currentChord.Strings[j] == SpecialStrings.QuarterBend)
                            {
                                toPrint = "b|4--";
                            }
                            else if (currentChord.Strings[j] == -1)
                            {
                                toPrint = "----";
                            }
                            else
                            {
                                //regular chord
                                toPrint = currentChord.Strings[j].ToString().PadLeft(4, '-');
                            }
                            _stringText[j + 1].Append(toPrint);
                        }

                        //process chord flags
                        switch (currentChord.ChordFlags)
                        {
                            case ChordFlags.None:
                                _stringText[-1].Append("    ");
                                break;
                            case ChordFlags.PalmMute:
                                _stringText[-1].Append("  PM");
                                break;
                            case ChordFlags.Harmonic:
                                _stringText[-1].Append("   H");
                                break;
                        }

                        if (counter == maxChordsInLine)
                        {
                            nextLine = true;
                            chordCount += maxChordsInLine;
                        }
                        else counter++;
                    }

                    if (counter != maxChordsInLine)
                    {
                        for (int i = counter; i <= maxChordsInLine; i++)
                        {
                            for (int j = 1; j <= _nStrings; j++)
                            {
                                _stringText[j].Append("----");
                            }

                            _stringText[-1].Append("    ");
                        }
                    }

                    for (int i = 1; i <= _nStrings; i++)
                    {
                        _stringText[i].Append("]\r\n");
                        retVal.Append(_stringText[i].ToString());
                    }
                    retVal.Append(_stringText[-1].ToString());

                    retVal.Append("\r\n\r\n");
                }
            }

            return retVal.ToString();
        }
Exemplo n.º 4
0
 /// <summary>
 /// Prints a list of phrases
 /// </summary>
 /// <param name="phrases">List of phrases</param>
 /// <param name="mode">Tuning mode</param>
 /// <param name="maxChordsInLine">Maximum number of chords in a single line</param>
 /// <returns>String representation of the list of phrases</returns>
 public static String PrintChords(List<Phrase> phrases, TuningMode mode, int maxChordsInLine)
 {
     StringBuilder retVal = new StringBuilder();
     for (int i = 0; i < phrases.Count; i++)
     {
         retVal.Append(FretMap.PrintChords(phrases[i].ToList(), mode, maxChordsInLine));
         retVal.Append("\r\n\r\n");
     }
     return retVal.ToString();
 }
Exemplo n.º 5
0
 public ScannerProps( byte[] data )
 {
     BinaryReader br = new System.IO.BinaryReader( new MemoryStream( data ) );
     WorkMode = (WorkMode)br.ReadInt16();
     DpiX0 = br.ReadInt16();
     DpiY0 = br.ReadInt16();
     DpiX1 = br.ReadInt16();
     DpiY1 = br.ReadInt16();
     DoubleSheet = (DoubleSheet)br.ReadInt16();
     Marker = (Marker)br.ReadInt16();
     DoubleSheetLevelL = br.ReadInt16();
     WhiteCoeff = (WhiteCoeff)br.ReadInt16();
     BinaryThreshold0 = br.ReadInt16();
     BinaryThreshold1 = br.ReadInt16();
     MinSheetLength = br.ReadInt16();
     MaxSheetLength = br.ReadInt16();
     DoubleSheetLevelR = br.ReadInt16();
     TuningMode = (TuningMode)br.ReadInt16();
     MarkerWork = br.ReadInt16();
     DirtDetection = (DirtDetection)br.ReadInt16();
     OfflineMode = br.ReadInt16();
     Lamps = (Lamps)br.ReadInt16();
     reserv = new short[21];
     for ( int i = 0; i < reserv.Length; i++ )
     {
         reserv[i] = br.ReadInt16();
     }
     br.Close();
 }