Inheritance: MonoBehaviour
Exemplo n.º 1
3
	private Notes _notes; // usermodel needs to Set this

	/**
	 * Constructs a Slide from the Slide record, and the SlideAtomsSet
	 *  Containing the text.
	 * Initialises TextRuns, to provide easier access to the text
	 *
	 * @param slide the Slide record we're based on
	 * @param notes the Notes sheet attached to us
	 * @param atomSet the SlideAtomsSet to Get the text from
	 */
	public Slide(NPOI.HSLF.record.Slide slide, Notes notes, SlideAtomsSet atomSet, int slideIdentifier, int slideNumber) {
        base(slide, slideIdentifier);

		_notes = notes;
		_atomSet = atomSet;
		_slideNo = slideNumber;

 		// Grab the TextRuns from the PPDrawing
		TextRun[] _otherRuns = FindTextRuns(getPPDrawing());

		// For the text coming in from the SlideAtomsSet:
		// Build up TextRuns from pairs of TextHeaderAtom and
		//  one of TextBytesAtom or TextCharsAtom
		Vector textRuns = new Vector();
		if(_atomSet != null) {
			FindTextRuns(_atomSet.GetSlideRecords(),textRuns);
		} else {
			// No text on the slide, must just be pictures
		}

		// Build an array, more useful than a vector
		_Runs = new TextRun[textRuns.Count+_otherRuns.Length];
		// Grab text from SlideListWithTexts entries
		int i=0;
		for(i=0; i<textRuns.Count; i++) {
			_Runs[i] = (TextRun)textRuns.Get(i);
            _Runs[i].SetSheet(this);
		}
		// Grab text from slide's PPDrawing
		for(int k=0; k<_otherRuns.Length; i++, k++) {
			_Runs[i] = _otherRuns[k];
            _Runs[i].SetSheet(this);
		}
	}
Exemplo n.º 2
0
 public bool UpdateNote(Notes instance)
 {
     Notes cache = Db.Notes.FirstOrDefault(p => p.Name == instance.Name);
     cache.Content = instance.Content;
     Db.Notes.Context.SubmitChanges();
     return true;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Scans through a notechart and assigns the HOPO tag to notes that are of a
        /// different type than the previous note, and have a tick difference less than
        /// the specified HOPO tick threshold.
        /// </summary>
        /// <param name="inputNotechart">
        /// Any notechart (expected to not have hammeron information already filled out).
        /// </param>
        /// <param name="inputChartInfo">
        /// All information pertaining to the chart.
        /// </param>
        /// <returns>
        /// The same notechart with proper hammeron note settings.
        /// </returns>
        public static Notes AssignHOPOS(Notes inputNotechart, Info inputChartInfo)
        {
            Notes notechartToReturn = inputNotechart;
            int HOPOTickThreshold = (inputChartInfo.resolution * 4) / inputChartInfo.HOPOThreshold;

            Note currentNote = new Note();
            Note nextNote = new Note();

            // We stop at (count - 2) due to the currentNote/nextNote/thirdNote setup
            for (int i = 0; i < inputNotechart.notes.Count - 1; i++)
            {
                currentNote = inputNotechart.notes[i];
                nextNote = inputNotechart.notes[i + 1];

                if (i == 470)
                {
                    nextNote.ToString();
                }

                // If difference is 0, it is a chord and should not be a hammeron.
                // We need to check the third note in case the next note is the start
                // of a chord.
                if (((nextNote.tickValue - currentNote.tickValue) <= HOPOTickThreshold) &&
                    (!nextNote.noteType.isEqual(currentNote.noteType)) &&
                    (!nextNote.isChord))
                {
                    notechartToReturn.notes[i + 1].isHOPO = true;
                }
            }

            return notechartToReturn;
        }
Exemplo n.º 4
0
	public void Go (Notes newNote, float newHeight, int newColor)
	{
		Debug.Log ("newColor: " + newColor);
		
		// GLA Up Top Fix Me
		if (newColor == 12) newColor = 11;
		
		particleSystem.startColor = colors[newColor];
		
		Debug.Log ("newNote: " + newNote);
		
		if((int)newNote>11)
		{
			switch(newNote)
			{
				case Notes.G_Major:
					PlayChord(Notes.C, 0);
					PlayChord(Notes.E, 1);
					PlayChord(Notes.C, 2);
				break;
				case Notes.D_Major:
					PlayChord(Notes.Gb, 0);
					PlayChord(Notes.D, 1);
					PlayChord(Notes.A, 1);
				break;
			}
		}
		else
		{
			audio.pitch =  Mathf.Pow(2, (12 * newHeight + (int)newNote)/12.0f);
			audio.Play();
		}
		
		Invoke("Death", audio.clip.length);
	}
Exemplo n.º 5
0
	public void OnMoneyCollision(Notes note)
	{
		Debug.Log("note: " + (int)note);
		playerController.stats.earnedMoney += (int)note;
		updater.UpdateUI();

		Debug.Log("MONEY: " + playerController.stats.earnedMoney);
	}
Exemplo n.º 6
0
 public Book()
 {
     for (int i = 0; i < NumberOfPages; i++)
     {
         string page = string.Format("Page {0}", i);
         Notes notes = new Notes(string.Format("Notes {0}", i));
         _pages.Add(new Tuple<string, Notes>(page, notes));
     }
 }
Exemplo n.º 7
0
 public bool CreateNote(Notes instance)
 {
     if (instance.ID == 0)
     {
         instance.AddedDate = DateTime.Now;
         Db.Notes.InsertOnSubmit(instance);
         Db.Notes.Context.SubmitChanges();
         return true;
     }
     return false;
 }
Exemplo n.º 8
0
	void PlayChord(Notes newNote, float newHeight)
	{
		GameObject chord = new GameObject("Chord");
		chord.AddComponent("AudioSource");
		chord.audio.clip = audio.clip;
		chord.audio.volume = audio.volume;
		chord.audio.playOnAwake = audio.playOnAwake;
		chord.audio.priority = audio.priority;
		chord.audio.loop = audio.loop;
		
		chord.audio.pitch = Mathf.Pow(2, (12 * newHeight + (int)newNote)/12.0f);
		chord.audio.Play();
	}
Exemplo n.º 9
0
 public static Notes InsertTbl_NotesTSW(Notes value)
 {
     Notes retval = new Notes();
     SqlParameter[] param = new SqlParameter[] {
         new SqlParameter("@FromLive", value.FromLive),
         //new SqlParameter("@SiteID", value.SiteID),
         new SqlParameter("@TourID", value.TourID),
         new SqlParameter("@NoteTypeID", value.NoteTypeID),
         new SqlParameter("@NoteText", value.NoteDesc),
         new SqlParameter("@UserName", value.NoteBy)
     };
     //throw new Exception(value.SiteID + "," + value.TourID+","+value.SystemNote);
     SqlHelper.ExecuteNonQuery(Helper.ConnectionString, CommandType.StoredProcedure, "ws_usp_CreateTourNote_BkUp", param);
     return retval;
 }
Exemplo n.º 10
0
 public static Notes Insert_AutomaticNotes(Notes value)
 {
     Notes retval = new Notes();
     SqlParameter[] param = new SqlParameter[] {
         new SqlParameter("@FromLive", value.FromLive),
         new SqlParameter("@ReservationNum", value.ReservationNum),
         new SqlParameter("@SubReservationNum", value.SubReservationNum),
         new SqlParameter("@PCIID", value.PCIID),
         new SqlParameter("@HotelNumber", value.HotelNumber),
         new SqlParameter("@NoteDesc", value.NoteDesc),
         new SqlParameter("@NoteBy", value.NoteBy),
         new SqlParameter("@SystemNote", value.SystemNote)
     };
     SqlHelper.ExecuteNonQuery(Helper.ConnectionString, CommandType.StoredProcedure, "insert_tblNotes", param);
     return retval;
 }
Exemplo n.º 11
0
        /// <summary>
        /// Creates a notechart from the specified midi path and the actual charttype
        /// (i.e. ExpertSingle from notes.mid).  Due to the overhead necessary to
        /// parse a midi file.  I am going to cram all midi->chart operations into
        /// one function call.
        /// This function uses the Sanford midi parser.  While it is horribly slow
        /// on larger (e.g. RB) midis, it works without a hitch on every midi I've
        /// come across.
        /// </summary>
        /// <param name="chartSelection">
        /// The information on which particular notechart to use.
        /// </param>
        /// <param name="chartInfo">The metadata on the chart.</param>
        /// <param name="BPMChanges">The list of BPM changes for this chart.</param>
        /// <returns>
        /// A filled out Notechart containing the needed information from the *.mid file.
        /// </returns>
        public static Notes ParseMidiInformationSanford(ChartSelection chartSelection,
            Info chartInfo,
            List<BPMChange> BPMChanges)
        {
            Notes notechartToReturn = new Notes();
            notechartToReturn.instrument = chartSelection.instrument;
            notechartToReturn.difficulty = chartSelection.difficulty;

            // The following two switch's are used to get the proper midi terminology for
            // the selected track and difficulty.
            string instrumentPart = null;
            int greenKey = 0;
            int redKey = 0;
            int yellowKey = 0;
            int blueKey = 0;
            int orangeKey = 0;

            switch (chartSelection.instrument)
            {
                case "Single":
                    instrumentPart = "PART GUITAR";
                    break;
                case "DoubleGuitar":
                    instrumentPart = "PART GUITAR COOP";
                    break;
                case "DoubleBass":
                    instrumentPart = "PART BASS";
                    break;
                case "Drums":
                    instrumentPart = "PART DRUMS";
                    break;
                default:
                    instrumentPart = "PART GUITAR";
                    break;
            }

            switch (chartSelection.difficulty)
            {
                case "Expert":
                    greenKey = 96;
                    redKey = 97;
                    yellowKey = 98;
                    blueKey = 99;
                    orangeKey = 100;
                    break;
                case "Hard":
                    greenKey = 84;
                    redKey = 85;
                    yellowKey = 86;
                    blueKey = 87;
                    orangeKey = 88;
                    break;
                case "Medium":
                    greenKey = 72;
                    redKey = 73;
                    yellowKey = 74;
                    blueKey = 75;
                    orangeKey = 76;
                    break;
                case "Easy":
                    greenKey = 60;
                    redKey = 61;
                    yellowKey = 62;
                    blueKey = 63;
                    orangeKey = 64;
                    break;
                default:
                    greenKey = 96;
                    redKey = 97;
                    yellowKey = 98;
                    blueKey = 99;
                    orangeKey = 100;
                    break;
            }

            Sequence mySequence = new Sequence(chartSelection.directory + "\\notes.mid");
            Track trackToUse = new Track();
            chartInfo.resolution = mySequence.Division;

            // Go through each event in the first track (which contains the BPM changes)
            // and parse the resulting string.
            Track sanTrack = mySequence[0];
            foreach (Sanford.Multimedia.Midi.MidiEvent currEvent in sanTrack.Iterator())
            {
                if (currEvent.MidiMessage.MessageType == MessageType.Meta)
                {
                    MetaMessage currMessage = currEvent.MidiMessage as MetaMessage;
                    //currTickValue += Convert.ToUInt32(splitEventString[1]);
                    if (currMessage.MetaType == MetaType.Tempo)
                    {
                        TempoChangeBuilder tempoBuilder = new TempoChangeBuilder(currMessage);
                        int midiBPMChange = tempoBuilder.Tempo;
                        // In midi files, bpm chages are stored as "microseconds per quarter note"
                        // and must be converted to BPM, and then into the non decimal format the game
                        // uses.
                        double currBPMDouble = 60000000 / (double)midiBPMChange;
                        uint BPMToAdd = (uint)(currBPMDouble * 1000);
                        BPMChanges.Add(new BPMChange((uint)currEvent.AbsoluteTicks, (uint)BPMToAdd));
                    }
                }
            }

            // Find the specified instrument's track
            for (int i = 1; i < mySequence.Count; i++)
            {
                sanTrack = mySequence[i];
                Sanford.Multimedia.Midi.MidiEvent currEvent = sanTrack.GetMidiEvent(0);
                if (currEvent.MidiMessage.MessageType == MessageType.Meta)
                {
                    MetaMessage currMessage = currEvent.MidiMessage as MetaMessage;
                    if (currMessage.MetaType == MetaType.TrackName)
                    {
                        MetaTextBuilder trackName = new MetaTextBuilder(currMessage);

                        // -If we come across a "T1 GEMS" track, we're in GH1 territory.
                        // -GH2/FoF has both PART BASS and PART RHYTHM (one or the other depending
                        //  on the chart).
                        if ((trackName.Text == instrumentPart) || (trackName.Text == "T1 GEMS") ||
                            ((trackName.Text == "PART RHYTHM") && (instrumentPart == "PART BASS")))
                        {
                            trackToUse = sanTrack;
                        }
                    }
                }
            }

            Note currNote = new Note();
            bool blankNote = true;
            // Scan through and record every note specific to the selected difficulty
            foreach (Sanford.Multimedia.Midi.MidiEvent currEvent in trackToUse.Iterator())
            {
                // We need to specify wether a note is blank or not so we don't add
                // blank notes from other difficulties into the chart, but if we have
                // a filled out note, any nonzero tick value means we are moving to a
                // new note, so we must cut our ties and add this note to the chart.
                if ((currEvent.DeltaTicks != 0) && !blankNote)
                {
                    notechartToReturn.notes.Add(currNote);
                    currNote = new Note();
                    blankNote = true;
                }

                if (currEvent.MidiMessage.MessageType == MessageType.Channel)
                {
                    ChannelMessage currMessage = currEvent.MidiMessage as ChannelMessage;
                    if (currMessage.Command == ChannelCommand.NoteOn)
                    {
                        // Only consider notes within the octave our difficulty is in.
                        if (((currMessage.Data1 == greenKey) || (currMessage.Data1 == redKey) ||
                            (currMessage.Data1 == yellowKey) || (currMessage.Data1 == blueKey) ||
                            (currMessage.Data1 == orangeKey)) && (currMessage.Data2 != 0))
                        {
                            // If it's a new note, we need to setup the tick value of it.
                            if (blankNote)
                            {
                                //currNote.TickValue = totalTickValue;
                                currNote.tickValue = (uint)currEvent.AbsoluteTicks;
                                blankNote = false;
                            }
                            if (currMessage.Data1 == greenKey) { currNote.addNote(0); }
                            else if (currMessage.Data1 == redKey) { currNote.addNote(1); }
                            else if (currMessage.Data1 == yellowKey) { currNote.addNote(2); }
                            else if (currMessage.Data1 == blueKey) { currNote.addNote(3); }
                            else if (currMessage.Data1 == orangeKey) { currNote.addNote(4); }
                        }
                    }

                }
            }

            return notechartToReturn;
        }
Exemplo n.º 12
0
        /// <summary>
        /// Simulates a chart playthrough and adds a milisecond value to each note and event within the
        /// current notechart. This is necessary because the *.chart file specification does not
        /// provide the user a specific time value.  It works by calulating how many ticks are to pass
        /// for every milisecond in relation to the current BPM (see formula below), and adds that to a
        /// total tick value.  Every iteration, 1 is added to the current milisecond.  When a note or event's
        /// tick value becomes less than the total tick value, its milisecond value is set to the current
        /// milisecond. 
        /// </summary>
        /// <param name="inputNotechart">
        /// The notechart that will be scanned.  A pass by refrence may be more efficent...
        /// </param>
        /// <param name="inputBPMChanges">
        /// The list of BPM changes that apply to the notechart.
        /// </param>
        /// <param name="inputEvents">
        /// The event list that will be scanned.  This list also gets its time values calculated, so a pass
        /// by refrence is necrssary.
        /// </param>
        /// <param name="chartInfo">
        /// The information (particularly the offset and milisecond chart length) of the chart.
        /// </param>
        /// <returns>
        /// A notechart that is the same as the input notechart, but every note has a milisecond value filled out.
        /// </returns>
        public static Notes GenerateTimeValues(Notes inputNotechart, List<BPMChange> inputBPMChanges,
            List<Event> inputEvents, Info chartInfo, List<Beatmarker> beatMarkers)
        {
            double currentTick = 0.0;
            double currentTickLoop = 0.0;
            double currentTicksPerMilisecond = (inputBPMChanges[0].BPMValue * chartInfo.resolution) / 60000000.0;
            uint currentMilisecond = (uint)(chartInfo.offset * 1000);  // Convert the chart offset into flat miliseconds

            int notechartIterator = 0;
            int SPNoteIterator = 0;
            int eventIterator = 0;
            int BPMChangeIterator = 0;

            EndofChartCondition endofChartCondition = new EndofChartCondition();
            Notes noteChartToReturn = inputNotechart;
            beatMarkers.Add(new Beatmarker(0, 1));  // Add the initial beatmarker for the start of the song

            // Keep working until no more events or notes are found
            while (endofChartCondition)
            {
                // Update the event time values
                if (eventIterator < inputEvents.Count)
                {
                    if (currentTick >= inputEvents[eventIterator].tickValue)
                    {
                        inputEvents[eventIterator].timeValue = currentMilisecond;
                        eventIterator++;
                    }
                }
                else
                {
                    endofChartCondition.noMoreEvents = true;
                }

                // Update the notes themselves
                if (notechartIterator < inputNotechart.notes.Count)
                {
                    while ((notechartIterator < inputNotechart.notes.Count) && (currentTick >= inputNotechart.notes[notechartIterator].tickValue))
                    {
                        inputNotechart.notes[notechartIterator].timeValue = currentMilisecond;
                        notechartIterator++;
                    }
                }
                else
                {
                    endofChartCondition.noMoreNotes = true;
                }

                // Update the Star Power notes
                if (SPNoteIterator < inputNotechart.SPNotes.Count)
                {
                    if (currentTick >= inputNotechart.SPNotes[SPNoteIterator].tickValue)
                    {
                        inputNotechart.SPNotes[SPNoteIterator].timeValue = currentMilisecond;
                        SPNoteIterator++;
                    }
                }
                else
                {
                    endofChartCondition.noMoreSPNotes = true;
                }

                if (currentTickLoop >= chartInfo.resolution)
                {
                    beatMarkers.Add(new Beatmarker(currentMilisecond, 1));
                    currentTickLoop = currentTickLoop - chartInfo.resolution;
                }

                // Update the BPM changes
                if (!(BPMChangeIterator >= inputBPMChanges.Count))
                {
                    currentTicksPerMilisecond = ((inputBPMChanges[BPMChangeIterator].BPMValue * chartInfo.resolution) / 60000000.0);

                    // IF the current bpm change is not the last, then increment the iterator
                    // (count is not zero based, and must be decremented by 1)
                    if (BPMChangeIterator < (inputBPMChanges.Count - 1))
                    {
                        if ((currentTick >= inputBPMChanges[BPMChangeIterator + 1].tickValue))
                        {
                            BPMChangeIterator++;
                        }
                    }
                }

                //else if (currentTickLoop

                currentTickLoop += currentTicksPerMilisecond;
                currentTick += currentTicksPerMilisecond;
                currentMilisecond++;
            }
            chartInfo.chartLengthMiliseconds = currentMilisecond;
            return noteChartToReturn;
        }
Exemplo n.º 13
0
 public Notes AddNote([FromBody] Notes note)
 {
     return(_notesService.addNote(note));
 }
Exemplo n.º 14
0
 public void AddNote(Notes n)
 {
     db.Notes.Add(n);
 }
Exemplo n.º 15
0
 public HWPFDocument()
     : base()
 {
     _endnotes = new NotesImpl(_endnotesTables);
     _footnotes = new NotesImpl(_footnotesTables);
     this._text = new StringBuilder("\r");
 }
Exemplo n.º 16
0
    public List<Notes> getPatientNotes(PatientObject patient)
    {
        if (Authenticated_AorC())
        {
            ReadOnlyCollection<Movement.Database.Patient> patientList = FindAPatient(patient);
            Movement.Database.PatientNote newNote;
            List<Notes> allNotes = new List<Notes>();
            Notes filler = new Notes();
            if (patientList.Count == 1)
            {
                try
                {
                    for (int i = 0; i < patientList[0].Notes.Count; i++)
                    {
                        newNote = patientList[0].Notes[i];
                        filler.author = newNote.Author.Name;
                        filler.note = newNote.Data;
                        filler.time = newNote.Timestamp;
                        allNotes.Add(filler);

                    }
                    return allNotes;
                }
                catch (Exception e)
                {
                    Log(e);
                    return null;
                }
            }
            return null;

        }
        else
        {
            throw new UnauthorizedAccessException("You are not authorized to perform that action!");
        }
    }
Exemplo n.º 17
0
 public void Beep(Notes note, int octave)
 {
     Console.Beep(GetFrequency(note, octave) - 16 + 37, 100);
     Thread.Sleep(100);
 }
Exemplo n.º 18
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as ProcedureRequest;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (Identifier != null)
                {
                    dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
                }
                if (Subject != null)
                {
                    dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy();
                }
                if (Code != null)
                {
                    dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy();
                }
                if (BodySite != null)
                {
                    dest.BodySite = new List <Hl7.Fhir.Model.CodeableConcept>(BodySite.DeepCopy());
                }
                if (Reason != null)
                {
                    dest.Reason = (Hl7.Fhir.Model.Element)Reason.DeepCopy();
                }
                if (Scheduled != null)
                {
                    dest.Scheduled = (Hl7.Fhir.Model.Element)Scheduled.DeepCopy();
                }
                if (Encounter != null)
                {
                    dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy();
                }
                if (Performer != null)
                {
                    dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy();
                }
                if (StatusElement != null)
                {
                    dest.StatusElement = (Code <Hl7.Fhir.Model.ProcedureRequest.ProcedureRequestStatus>)StatusElement.DeepCopy();
                }
                if (Notes != null)
                {
                    dest.Notes = new List <Hl7.Fhir.Model.Annotation>(Notes.DeepCopy());
                }
                if (AsNeeded != null)
                {
                    dest.AsNeeded = (Hl7.Fhir.Model.Element)AsNeeded.DeepCopy();
                }
                if (OrderedOnElement != null)
                {
                    dest.OrderedOnElement = (Hl7.Fhir.Model.FhirDateTime)OrderedOnElement.DeepCopy();
                }
                if (Orderer != null)
                {
                    dest.Orderer = (Hl7.Fhir.Model.ResourceReference)Orderer.DeepCopy();
                }
                if (PriorityElement != null)
                {
                    dest.PriorityElement = (Code <Hl7.Fhir.Model.ProcedureRequest.ProcedureRequestPriority>)PriorityElement.DeepCopy();
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }
Exemplo n.º 19
0
 public IActionResult Post([FromForm] Notes note)
 {
     _context.Notes.Add(note);
     _context.SaveChanges();
     return(Ok());
 }
Exemplo n.º 20
0
    private NoteData ParseNotes(List <string> notes)
    {
        NoteData noteData = new NoteData();

        noteData.bars = new List <List <Notes> >();

        List <Notes> bar = new List <Notes>();

        for (int i = 0; i < notes.Count; i++)
        {
            string line = notes[i].Trim();

            if (line.StartsWith(";"))
            {
                break;
            }

            if (line.EndsWith(","))
            {
                noteData.bars.Add(bar);
                bar = new List <Notes>();
            }
            else if (line.EndsWith(":"))
            {
                continue;
            }
            else if (line.Length >= 5)
            {
                Notes note = new Notes();
                note.aNote   = false;
                note.bNote   = false;
                note.spcNote = false;
                note.cNote   = false;
                note.dNote   = false;

                //ALSO!! MAKE SURE ALL THE COMMENTS FOR MEASURES ARE REMOVED OR THE BARS WON'T LOAD
                // 0 = nothing there
                // 1 = note
                // 2 = hold note starts
                // 3 = hold note ends
                if (line[0] != '0')
                {
                    note.aNote = true;
                }
                if (line[1] != '0')
                {
                    note.bNote = true;
                }
                if (line[2] != '0')
                {
                    note.spcNote = true;
                }
                if (line[3] != '0')
                {
                    note.cNote = true;
                }
                if (line[4] != '0')
                {
                    note.dNote = true;
                }

                bar.Add(note);
            }
        }

        return(noteData);
    }
Exemplo n.º 21
0
 public async Task <Notes> AddNotes(long id, [FromBody] Notes notes)
 {
     return(await _requestService.AddNotes(id, notes));
 }
Exemplo n.º 22
0
 public void NotesTest()
 {
     Notes notes = new Notes();
 }
Exemplo n.º 23
0
 public bool OnNote(Notes note, List <Notes> fullRhythm)
 {
     return(false);
 }
Exemplo n.º 24
0
 public Pitch(Notes note, Octaves ocatave)
 {
     _note = note;
     _oct = ocatave;
 }
Exemplo n.º 25
0
 void SaveNotesPMS(string parControl, bool parSystemNote)
 {
     Notes item = new Notes();
     item.FromLive = m_FromLive;
     item.ReservationNum = 0;
     item.PCIID = parPCIID;
     item.HotelNumber = SIHOTHotelCode;
     item.NoteBy = varSystemUser;
     item.SystemNote = parSystemNote;
     //item.NoteDesc = txtComments.Text.Trim();
     item.NoteDesc =  this.txtPopUpComments.Text.Trim();
     NotesDB.InsertTbl_Notes(item);
 }
Exemplo n.º 26
0
        public override async Task <ResultType> Run(CancellationToken cancellationToken)
        {
            if (cancellationToken.IsCancellationRequested)
            {
                return(ResultType.Cancelled);
            }

            JobStatus = VideoJobStatus.Running;
            if ((VideoInfo as YoutubeVideoInfo) == null)
            {
                Status = "Retrieving video info...";
                bool wantCookies = Notes != null && Notes.Contains("cookies");
                var  result      = await Youtube.RetrieveVideo(VideoInfo.VideoId, VideoInfo.Username, wantCookies);

                switch (result.result)
                {
                case Youtube.RetrieveVideoResult.Success:
                    VideoInfo = result.info;
                    break;

                case Youtube.RetrieveVideoResult.ParseFailure:
                    // this seems to happen randomly from time to time, just retry later
                    return(ResultType.TemporarilyUnavailable);

                default:
                    return(ResultType.Failure);
                }
            }

            string filenameWithoutExtension = "youtube_" + VideoInfo.Username + "_" + VideoInfo.VideoTimestamp.ToString("yyyy-MM-dd") + "_" + VideoInfo.VideoId;
            string filename     = filenameWithoutExtension + ".mkv";
            string tempFolder   = Path.Combine(Util.TempFolderPath, filenameWithoutExtension);
            string tempFilepath = Path.Combine(tempFolder, filename);

            {
                if (!await Util.FileExists(tempFilepath))
                {
                    if (cancellationToken.IsCancellationRequested)
                    {
                        return(ResultType.Cancelled);
                    }

                    Directory.CreateDirectory(tempFolder);
                    Status = "Running youtube-dl...";
                    await StallWrite(tempFilepath, 0, cancellationToken);                       // don't know expected filesize, so hope we have a sensible value in minimum free space

                    if (cancellationToken.IsCancellationRequested)
                    {
                        return(ResultType.Cancelled);
                    }
                    List <string> args = new List <string>()
                    {
                        "-f", "bestvideo[height<=?1080]+bestaudio/best",
                        "-o", tempFilepath,
                        "--merge-output-format", "mkv",
                        "--no-color",
                        "--abort-on-error",
                        "--abort-on-unavailable-fragment",
                        "--no-sponsorblock",
                    };
                    string limit = Util.YoutubeSpeedLimit;
                    if (limit != "")
                    {
                        args.Add("--rate-limit");
                        args.Add(limit);
                    }
                    bool wantCookies = Notes != null && Notes.Contains("cookies");
                    if (wantCookies)
                    {
                        args.Add("--cookies");
                        args.Add(@"d:\cookies.txt");
                    }
                    bool nokill = Notes != null && Notes.Contains("nokill");
                    args.Add("https://www.youtube.com/watch?v=" + VideoInfo.VideoId);
                    var data = await ExternalProgramExecution.RunProgram(
                        @"yt-dlp", args.ToArray(), youtubeSpeedWorkaround : !nokill,
                        stdoutCallbacks : new System.Diagnostics.DataReceivedEventHandler[1] {
                        (sender, received) => {
                            if (!String.IsNullOrEmpty(received.Data))
                            {
                                Status = received.Data;
                            }
                        }
                    }
                        );
                }

                string finalFilename = GenerateOutputFilename();
                string finalFilepath = Path.Combine(Util.TargetFolderPath, finalFilename);
                if (File.Exists(finalFilepath))
                {
                    throw new Exception("File exists: " + finalFilepath);
                }

                Status = "Waiting for free disk IO slot to move...";
                try {
                    await Util.ExpensiveDiskIOSemaphore.WaitAsync(cancellationToken);
                } catch (OperationCanceledException) {
                    return(ResultType.Cancelled);
                }
                try {
                    // sanity check
                    Status = "Sanity check on downloaded video...";
                    TimeSpan actualVideoLength   = (await FFMpegUtil.Probe(tempFilepath)).Duration;
                    TimeSpan expectedVideoLength = VideoInfo.VideoLength;
                    if (actualVideoLength.Subtract(expectedVideoLength).Duration() > TimeSpan.FromSeconds(5))
                    {
                        // if difference is bigger than 5 seconds something is off, report
                        Status = "Large time difference between expected (" + expectedVideoLength.ToString() + ") and actual (" + actualVideoLength.ToString() + "), stopping.";
                        return(ResultType.Failure);
                    }

                    Status = "Moving...";
                    await Task.Run(() => Util.MoveFileOverwrite(tempFilepath, finalFilepath));

                    await Task.Run(() => Directory.Delete(tempFolder));
                } finally {
                    Util.ExpensiveDiskIOSemaphore.Release();
                }
            }

            Status    = "Done!";
            JobStatus = VideoJobStatus.Finished;
            return(ResultType.Success);
        }
Exemplo n.º 27
0
        public static Folder GetFolder(string id)
        {
            var notes = new Notes();

            return(Folder.AllFolders.FirstOrDefault(x => x.Id == id));
        }
Exemplo n.º 28
0
        private int NotesIndexInClef(Note note)
        {
            var dd = Notes.DistanceFromMid(note, ActiveClef);

            return(dd);
        }
Exemplo n.º 29
0
 public void AddNewNote()
 {
     Notes.Add(new Note(NewText, DateTime.Now));
     NewText     = string.Empty;
     NewDateTime = DateTime.MinValue;
 }
Exemplo n.º 30
0
        /// <summary>
        /// 读取结构
        /// </summary>
        /// <param name="buffer"></param>
        /// <param name="starIndex"></param>
        /// <param name="key"></param>
        /// <returns></returns>
        private bool GetValueText(byte[] buffer, ref int starIndex, string key)
        {
            switch (key)
            {
            case "ANNOUNCE":
                Announce = GetKeyText(buffer, ref starIndex).ToString();
                break;

            case "ANNOUNCE-LIST":
                int       listCount = 0;
                ArrayList _tempList = GetKeyData(buffer, ref starIndex, ref listCount);
                for (int i = 0; i != _tempList.Count; i++)
                {
                    AnnounceList.Add(_tempList[i].ToString());
                }
                break;

            case "CREATION DATE":
                object date = GetKeyNumb(buffer, ref starIndex).ToString();
                if (date == null)
                {
                    if (OpenError.Length == 0)
                    {
                        OpenError = "CREATION DATE 返回不是数字类型";
                    }
                    return(false);
                }
                CreateTime = CreateTime.AddTicks(long.Parse(date.ToString()));
                break;

            case "CODEPAGE":
                object codePageNumb = GetKeyNumb(buffer, ref starIndex);
                if (codePageNumb == null)
                {
                    if (OpenError.Length == 0)
                    {
                        OpenError = "CODEPAGE 返回不是数字类型";
                    }
                    return(false);
                }
                CodePage = long.Parse(codePageNumb.ToString());
                break;

            case "ENCODING":
                Encoding = GetKeyText(buffer, ref starIndex).ToString();
                break;

            case "CREATED BY":
                CreatedBy = GetKeyText(buffer, ref starIndex).ToString();
                break;

            case "COMMENT":
                Comment = GetKeyText(buffer, ref starIndex).ToString();
                break;

            case "COMMENT.UTF-8":
                CommentUTF8 = GetKeyText(buffer, ref starIndex).ToString();
                break;

            case "INFO":
                int fileListCount = 0;
                GetFileInfo(buffer, ref starIndex, ref fileListCount);
                break;

            case "NAME":
                Name = GetKeyText(buffer, ref starIndex).ToString();
                break;

            case "NAME.UTF-8":
                NameUTF8 = GetKeyText(buffer, ref starIndex).ToString();
                break;

            case "PIECE LENGTH":
                object pieceLengthNumb = GetKeyNumb(buffer, ref starIndex);
                if (pieceLengthNumb == null)
                {
                    if (OpenError.Length == 0)
                    {
                        OpenError = "PIECE LENGTH 返回不是数字类型";
                    }
                    return(false);
                }
                PieceLength = long.Parse(pieceLengthNumb.ToString());
                break;

            case "PIECES":
                Pieces = GetKeyByte(buffer, ref starIndex);
                break;

            case "PUBLISHER":
                Publisher = GetKeyText(buffer, ref starIndex).ToString();
                break;

            case "PUBLISHER.UTF-8":
                PublisherUTF8 = GetKeyText(buffer, ref starIndex).ToString();
                break;

            case "PUBLISHER-URL":
                PublisherUrl = GetKeyText(buffer, ref starIndex).ToString();
                break;

            case "PUBLISHER-URL.UTF-8":
                PublisherUrlUTF8 = GetKeyText(buffer, ref starIndex).ToString();
                break;

            case "NODES":
                int       nodesCount = 0;
                ArrayList _nodesList = GetKeyData(buffer, ref starIndex, ref nodesCount);
                int       ipCount    = _nodesList.Count / 2;
                for (int i = 0; i != ipCount; i++)
                {
                    Notes.Add(_nodesList[i * 2] + ":" + _nodesList[(i * 2) + 1]);
                }
                break;

            default:
                return(false);
            }
            return(true);
        }
Exemplo n.º 31
0
	/**
	 * Sets the Notes that are associated with this. Updates the
	 *  references in the records to point to the new ID
	 */
	public void SetNotes(Notes notes) {
		_notes = notes;

		// Update the Slide Atom's ID of where to point to
		SlideAtom sa = GetSlideRecord().GetSlideAtom();

		if(notes == null) {
			// Set to 0
			sa.SetNotesID(0);
		} else {
			// Set to the value from the notes' sheet id
			sa.SetNotesID(notes._getSheetNumber());
		}
	}
Exemplo n.º 32
0
        public static async Task <bool> RemoveNote(Note note, bool reflectOnRoaming = true)
        {
            if (note == null)
            {
                return(false);
            }

            Note noteFound = null;

            //get original reference
            if (notes != null)
            {
                try
                {
                    if (note.IsArchived)
                    {
                        LoadArchivedNotesIfNecessary();
                        noteFound = ArchivedNotes.FirstOrDefault(x => x.ID == note.ID);
                        if (ArchivedNotes.IndexOf(noteFound) < 0)
                        {
                            noteFound = null;
                        }
                    }
                    else
                    {
                        noteFound = Notes.FirstOrDefault(x => x.ID == note.ID);
                        if (Notes.IndexOf(note) < 0)
                        {
                            noteFound = null;
                        }
                    }
                }
                catch (Exception)
                {
                    Debug.WriteLine("Failed removing note.");
                    return(false);
                }
            }

            Debug.WriteLine("Remove note: " + note.Title);
            //App.TelemetryClient.TrackEvent("NoteRemoved");

            //remove note images from disk
            await RemoveNoteImages(note.Images);

            RemoveNoteReminders(note);
            NotificationsManager.RemoveTileIfExists(note.ID);

            if (noteFound == null)
            {
                return(false);
            }

            noteFound.SoftDelete();

            bool success = LocalDB.Update(noteFound) == 1;

            if (!success)
            {
                return(false);
            }

            if (reflectOnRoaming)
            {
                RoamingDB.Update(noteFound);
            }

            //LocalDB.Delete(noteFound);
            //RoamingDB.Delete(noteFound);

            AppData.Notes.Remove(noteFound);
            AppData.ArchivedNotes.Remove(noteFound);

            var handler = NoteRemoved;

            if (handler != null)
            {
                handler(null, new NoteIdEventArgs(noteFound.ID));
            }

            var handler2 = NotesSaved;

            if (handler2 != null)
            {
                handler2(null, EventArgs.Empty);
            }

            return(true);
        }
        public IFacebookApi Initialize(IFacebookSession session)
        {
            AuthToken = string.Empty;

            #if !SILVERLIGHT
            InstalledCulture = CultureInfo.InstalledUICulture;
            #else
            InstalledCulture = CultureInfo.CurrentUICulture;
            #endif

            Session = session;

            Auth = new Auth(Session);
            Video = new Video(Session);
            Marketplace = new Marketplace(Session);
            Admin = new Admin(Session);
            Photos = new Photos(Session);
            Users = new Users(Session);
            Friends = new Friends(Users, Session);
            Events = new Events(Session);
            Groups = new Groups(Session);
            Notifications = new Notifications(Session);
            Profile = new Profile(Session);
            Fbml = new Fbml(Session);
            Feed = new Feed(Session);
            Fql = new Fql(Session);
            LiveMessage = new LiveMessage(Session);
            Message = new Message(Session);
            Batch = new Batch(Session);
            Pages = new Pages(Session);
            Application = new Application(Session);
            Data = new Data(Session);
            Permissions = new Permissions(Session);
            Connect = new Connect(Session);
            Comments = new Comments(Session);
            Stream = new Stream(Session);
            Status = new Status(Session);
            Links = new Links(Session);
            Notes = new Notes(Session);
            Intl = new Intl(Session);

            Batch.Batch = Batch;
            Permissions.Permissions = Permissions;
            Batch.Permissions = Permissions;
            Permissions.Batch = Batch;

            foreach (IRestBase restBase in new IRestBase[] {Auth, Video, Marketplace, Admin, Photos, Users, Friends, Events,
                Groups, Notifications, Profile, Fbml, Feed, Fql, LiveMessage, Message, Pages, Application, Data, Connect, Comments,
                Stream, Status, Links, Notes})
            {
                restBase.Batch = Batch;
                restBase.Permissions = Permissions;
            }

            return this;
        }
Exemplo n.º 34
0
        public void CalculateNotes(Notes rootNote)
        {
            ScaleNotes.Clear();
            ScaleNotes.Add(new ScaleNote(rootNote, NoteType.ROOT, Intervals[0]));


            for (int i = 1; i <= Intervals.Count - 1; i++)
            {
                Notes note     = rootNote;
                int   interval = (int)m_intervals[Intervals[i]];


                if ((int)note + interval > 11)
                {
                    note = (Notes)((interval + (int)note) % 12);
                }
                else
                {
                    note += interval;
                }

                ScaleNote sNote = null /* TODO Change to default(_) if this is not a reference type */;

                switch (Intervals[i])
                {
                case "3":
                case "3b":
                {
                    sNote = new ScaleNote(note, NoteType.THIRD, Intervals[i]);
                    break;
                }

                case "5":
                {
                    sNote = new ScaleNote(note, NoteType.FIFTH, Intervals[i]);
                    break;
                }

                case "7":
                case "7b":
                {
                    sNote = new ScaleNote(note, NoteType.SEVENTH, Intervals[i]);
                    break;
                }

                case "13":
                {
                    sNote = new ScaleNote(note, NoteType.THIRTEENTH, Intervals[i]);
                    break;
                }

                case "9":
                {
                    sNote = new ScaleNote(note, NoteType.NINTH, Intervals[i]);
                    break;
                }

                default:
                {
                    if (this.BlueNotes.Contains(Intervals[i]))
                    {
                        sNote = new ScaleNote(note, NoteType.BLUE, Intervals[i]);
                    }
                    else
                    {
                        sNote = new ScaleNote(note, NoteType.SCALE, Intervals[i]);
                    }
                    break;
                }
                }

                ScaleNotes.Add(sNote);
            }
        }
Exemplo n.º 35
0
 public Notes updateNote([FromBody] Notes note)
 {
     return(_notesService.updateNote(note));
 }
Exemplo n.º 36
0
        public ArrayList GetChords()
        {
            ArrayList a = new ArrayList();



            for (int j = 0; j <= this.ScaleNotes.Count - 1; j++)
            {
                Notes  note      = this.ScaleNotes[j].Note;
                string chordName = note.ToString();
                string flatFive  = string.Empty;


                for (int i = 3 + j; i <= 13 + j; i += 2)
                {
                    int iNote = 0;
                    iNote = (i - 1) % this.ScaleNotes.Count;

                    Notes nextNote = this.ScaleNotes[iNote].Note;

                    int interval = 0;
                    if (nextNote > note)
                    {
                        interval = nextNote - note;
                    }
                    else if (nextNote < note)
                    {
                        interval = nextNote - note + 12;
                    }


                    switch (i - j)
                    {
                    case 3:
                    {
                        if (interval == 3)
                        {
                            chordName += "Min";
                        }
                        break;
                    }

                    case 5:
                    {
                        switch (interval)
                        {
                        case 6:
                        {
                            flatFive = "b5";
                            break;
                        }

                        case 8:
                        {
                            flatFive = "#5";
                            break;
                        }
                        }

                        break;
                    }

                    case 7:
                    {
                        switch (interval)
                        {
                        case 10:
                        {
                            chordName += "7";
                            break;
                        }

                        case 9:
                        {
                            chordName += "Min7";
                            break;
                        }

                        case 11:
                        {
                            chordName += "Maj7";
                            break;
                        }
                        }

                        chordName += flatFive;
                        break;
                    }

                    case 9:
                    {
                        switch (interval)
                        {
                        case 3             // 15
                            :
                        {
                            chordName += "#9";
                            break;
                        }

                        case 1             // 13
                            :
                        {
                            chordName += "b9";
                            break;
                        }
                        }

                        break;
                    }

                    case 11:
                    {
                        switch (interval)
                        {
                        case 6             // 18
                            :
                        {
                            chordName += "#11";
                            break;
                        }

                        case 4             // 16
                            :
                        {
                            chordName += "b11";
                            break;
                        }
                        }

                        break;
                    }

                    case 13:
                    {
                        switch (interval)
                        {
                        case 8             // 20
                            :
                        {
                            chordName += "b13";
                            break;
                        }

                        case 10             // 22
                            :
                        {
                            chordName += "#13";
                            break;
                        }
                        }

                        break;
                    }
                    }
                }
                a.Add(chordName);
            }


            return(a);
        }
Exemplo n.º 37
0
        /// <summary>
        /// Creates a notechart from the specified midi path and the actual charttype
        /// (i.e. ExpertSingle from notes.mid).  Due to the overhead necessary to
        /// parse a midi file.  I am going to cram all midi->chart operations into
        /// one function call.
        /// This function uses the Toub midi parser which is much faster than Sanford,
        /// but will throw an exception on certian midi files.
        /// </summary>
        /// <param name="chartSelection">
        /// The information on which particular notechart to use.
        /// </param>
        /// <param name="chartInfo">The metadata on the chart.</param>
        /// <param name="BPMChanges">The list of BPM changes for this chart.</param>
        /// <returns>
        /// A filled out Notechart containing the needed information from the *.mid file.
        /// </returns>
        public static Notes ParseMidiInformationToub(ChartSelection chartSelection,
            Info chartInfo,
            List<BPMChange> BPMChanges)
        {
            Notes notechartToReturn = new Notes();
            notechartToReturn.instrument = chartSelection.instrument;
            notechartToReturn.difficulty = chartSelection.difficulty;

            // The following two switch's are used to get the proper midi terminology for
            // the selected track and difficulty.
            string instrumentPart = null;
            string greenKey = null;
            string redKey = null;
            string yellowKey = null;
            string blueKey = null;
            string orangeKey = null;

            switch (chartSelection.instrument)
            {
                case "Single":
                    instrumentPart = "PART GUITAR";
                    break;
                case "DoubleGuitar":
                    instrumentPart = "PART GUITAR COOP";
                    break;
                case "DoubleBass":
                    instrumentPart = "PART BASS";
                    break;
                case "Drums":
                    instrumentPart = "PART DRUMS";
                    break;
                default:
                    instrumentPart = "PART GUITAR";
                    break;
            }

            switch (chartSelection.difficulty)
            {
                case "Expert":
                    greenKey = "C8";
                    redKey = "C#8";
                    yellowKey = "D8";
                    blueKey = "D#8";
                    orangeKey = "E8";
                    break;
                case "Hard":
                    greenKey = "C7";
                    redKey = "C#7";
                    yellowKey = "D7";
                    blueKey = "D#7";
                    orangeKey = "E7";
                    break;
                case "Medium":
                    greenKey = "C6";
                    redKey = "C#6";
                    yellowKey = "D6";
                    blueKey = "D#6";
                    orangeKey = "E6";
                    break;
                case "Easy":
                    greenKey = "C5";
                    redKey = "C#5";
                    yellowKey = "D5";
                    blueKey = "D#5";
                    orangeKey = "E5";
                    break;
                default:
                    greenKey = "C8";
                    redKey = "C#8";
                    yellowKey = "D8";
                    blueKey = "D#8";
                    orangeKey = "E8";
                    break;
            }

            MidiSequence mySequence = MidiSequence.Import(chartSelection.directory + "\\notes.mid");
            MidiTrack[] myTracks = mySequence.GetTracks();
            chartInfo.resolution = mySequence.Division;

            MidiTrack trackToUse = new MidiTrack();
            uint totalTickValue = 0;

            // Go through each event in the first track (which contains the BPM changes)
            // and parse the resulting string.
            for (int i = 0; i < myTracks[0].Events.Count; i++)
            {
                Toub.Sound.Midi.MidiEvent currEvent = myTracks[0].Events[i];
                string eventString = currEvent.ToString();
                string[] splitEventString = eventString.Split('\t');

                // Since ticks are stored relative to each other (e.g. 300 ticks
                // until next note), we must maintain the total tick amout.
                totalTickValue += Convert.ToUInt32(splitEventString[1]);
                if (splitEventString[0] == "Tempo")
                {
                    // In midi files, bpm chages are stored as "microseconds per quarter note"
                    // and must be converted to BPM, and then into the non decimal format the game
                    // uses.
                    double currBPMDouble = 60000000 / Convert.ToDouble(splitEventString[3]);
                    uint BPMToAdd = (uint)(currBPMDouble * 1000);
                    BPMChanges.Add(new BPMChange(totalTickValue, BPMToAdd));
                }
            }

            trackToUse = new MidiTrack();
            // Find the specified instrument's track
            foreach (MidiTrack currTrack in myTracks)
            {
                string trackHeader = currTrack.Events[0].ToString();
                string[] splitHeader = trackHeader.Split('\t');

                // -If we come across a "T1 GEMS" track, we're in GH1 territory.
                // -GH2/FoF has both PART BASS and PART RHYTHM (one or the other depending
                //  on the chart).
                if (((splitHeader[3] == instrumentPart) || (splitHeader[3] == "T1 GEMS")) ||
                    ((splitHeader[3] == "PART RHYTHM") && (instrumentPart == "PART BASS")))
                {
                    trackToUse = currTrack;
                }
            }

            totalTickValue = 0;
            uint currTickValue = 0;
            Note currNote = new Note();
            bool blankNote = true;
            // Scan through and record every note specific to the selected difficulty
            for (int i = 0; i < trackToUse.Events.Count; i++)
            {
                string currEvent = trackToUse.Events[i].ToString();
                string[] splitEvent = currEvent.Split('\t');
                currTickValue = Convert.ToUInt32(splitEvent[1]);
                totalTickValue += currTickValue;

                // We need to specify wether a note is blank or not so we don't add
                // blank notes from other difficulties into the chart, but if we have
                // a filled out note, any nonzero tick value means we are moving to a
                // new note, so we must cut our ties and add this note to the chart.
                if ((currTickValue != 0) && !blankNote)
                {
                    notechartToReturn.notes.Add(currNote);
                    currNote = new Note();
                    blankNote = true;
                }

                // The "0x64" I think means "not was hit."  There is another
                // set of notes that use "0x00" that all appear slightly after
                // the "0x64" notes.
                if ((splitEvent[0] == "NoteOn") && (splitEvent[4] != "0x00"))
                {
                    // Only consider notes within the octave our difficulty is in.
                    if ((splitEvent[3] == greenKey) || (splitEvent[3] == redKey) ||
                        (splitEvent[3] == yellowKey) || (splitEvent[3] == blueKey) ||
                        (splitEvent[3] == orangeKey))
                    {
                        // If it's a new note, we need to setup the tick value of it.
                        if (blankNote)
                        {
                            currNote.tickValue = totalTickValue;
                            blankNote = false;
                        }
                        if (splitEvent[3] == greenKey) { currNote.addNote(0); }
                        else if (splitEvent[3] == redKey) { currNote.addNote(1); }
                        else if (splitEvent[3] == yellowKey) { currNote.addNote(2); }
                        else if (splitEvent[3] == blueKey) { currNote.addNote(3); }
                        else if (splitEvent[3] == orangeKey) { currNote.addNote(4); }
                    }
                }
            }

            return notechartToReturn;
        }
Exemplo n.º 38
0
 public async void SubmitNotes([FromBody] Notes notes)
 {
     //Do code here
     new NotImplementedException();
 }
Exemplo n.º 39
0
 public static uint GetFrequencyFor(Notes n, Octaves o = Octaves.O4)
 {
     double offset = ((int)o * 12) + n.IndexOf<Notes>();
     return (uint)(__rootpitch * Math.Pow(__a, offset));
 }
Exemplo n.º 40
0
 public async void UpdateNotes(int id, [FromBody] Notes notes)
 {
     //Do Code Here
     throw new NotImplementedException();
 }
Exemplo n.º 41
0
 //Methods that are not explicitly marked otherwise (such as yours) are PRIVATE
 //Change your code to:
 //protected void R1_ItemCommand....
 protected void R1_ItemCommand(Object Sender, RepeaterCommandEventArgs e)
 {
     //throw new Exception("Gyros");
     lblTest.Text = "The " + ((Button)e.CommandSource).Text + " button has just been clicked; <br />";
     //this.lblTest.Text = "The " + ((ImageButton)e.CommandSource).ToString() + " button has just been clicked; <br />";
     if (e.CommandName.ToLower().Equals("processnotes"))
     {
         Notes comment = new Notes();
         comment.PCIID = int.Parse(((Button)e.CommandSource).CommandArgument);
         lblTest.Text += comment.PCIID;
         parPCIID = comment.PCIID;
         litPopUpComments.Text = Helper.ToString(comment.PCIID);
         //((AjaxControlToolkit.ModalPopupExtender)e.Item.FindControl("ModalPopupExtender1")).Show();
         parPCIID = comment.PCIID;
         ShowComments();
         PanelNotes.Visible = true;
         PanelMain.Visible = false;
         //comment.DeleteRecord();
         //rptComments.DataBind();
         //rptProspects.DataBind();
     }
 }
 /// <summary>
 /// Filter by note words and #tags.
 /// </summary>
 public GraphQueryArgument <string> NotesQueryArgument(string value)
 {
     return(Notes.GetQueryArgumentAndSetValue(value));
 }
Exemplo n.º 43
0
 public int GetFrequency(Notes note, int octave)
 {
     return this.Frequencies[((int)note) * 8 + octave];
 }
Exemplo n.º 44
0
 /// <summary>
 /// Play a musical note
 /// </summary>
 /// <param name="note">note to play</param>
 /// <param name="duration">duration in ms</param>
 public static void PlayNote(Notes note, int duration)
 {
     Console.Beep(GetNote(note), duration);
 }
Exemplo n.º 45
0
 public Book(string title, string author)
 {
     Title = title;
     Author = author;
     BookNotes = new Notes();
 }
Exemplo n.º 46
0
        /// <summary>
        /// Get the frequency for Console.Beep for a particular note
        /// </summary>
        /// <param name="note">The target note</param>
        /// <returns>Frequency of note</returns>
        private static int GetNote(Notes note)
        {
            switch (note)
            {
            case Notes.C0: return(16);

            case Notes.Cs0: return(17);

            case Notes.Db0: return(17);

            case Notes.D0: return(18);

            case Notes.Ds0: return(19);

            case Notes.Eb0: return(19);

            case Notes.E0: return(21);

            case Notes.F0: return(22);

            case Notes.Fs0: return(23);

            case Notes.Gb0: return(23);

            case Notes.G0: return(25);

            case Notes.Gs0: return(26);

            case Notes.Ab0: return(26);

            case Notes.A0: return(28);

            case Notes.As0: return(29);

            case Notes.Bb0: return(29);

            case Notes.B0: return(31);

            case Notes.C1: return(33);

            case Notes.Cs1: return(35);

            case Notes.Db1: return(35);

            case Notes.D1: return(37);

            case Notes.Ds1: return(39);

            case Notes.Eb1: return(39);

            case Notes.E1: return(41);

            case Notes.F1: return(44);

            case Notes.Fs1: return(46);

            case Notes.Gb1: return(46);

            case Notes.G1: return(49);

            case Notes.Gs1: return(52);

            case Notes.Ab1: return(52);

            case Notes.A1: return(55);

            case Notes.As1: return(58);

            case Notes.Bb1: return(58);

            case Notes.B1: return(62);

            case Notes.C2: return(65);

            case Notes.Cs2: return(69);

            case Notes.Db2: return(69);

            case Notes.D2: return(73);

            case Notes.Ds2: return(78);

            case Notes.Eb2: return(78);

            case Notes.E2: return(82);

            case Notes.F2: return(87);

            case Notes.Fs2: return(93);

            case Notes.Gb2: return(93);

            case Notes.G2: return(98);

            case Notes.Gs2: return(104);

            case Notes.Ab2: return(104);

            case Notes.A2: return(110);

            case Notes.As2: return(117);

            case Notes.Bb2: return(117);

            case Notes.B2: return(123);

            case Notes.C3: return(131);

            case Notes.Cs3: return(139);

            case Notes.Db3: return(139);

            case Notes.D3: return(147);

            case Notes.Ds3: return(156);

            case Notes.Eb3: return(156);

            case Notes.E3: return(165);

            case Notes.F3: return(175);

            case Notes.Fs3: return(185);

            case Notes.Gb3: return(185);

            case Notes.G3: return(196);

            case Notes.Gs3: return(208);

            case Notes.Ab3: return(208);

            case Notes.A3: return(220);

            case Notes.As3: return(233);

            case Notes.Bb3: return(233);

            case Notes.B3: return(247);

            case Notes.C4: return(262);

            case Notes.Cs4: return(277);

            case Notes.Db4: return(277);

            case Notes.D4: return(294);

            case Notes.Ds4: return(311);

            case Notes.Eb4: return(311);

            case Notes.E4: return(330);

            case Notes.F4: return(349);

            case Notes.Fs4: return(370);

            case Notes.Gb4: return(370);

            case Notes.G4: return(392);

            case Notes.Gs4: return(415);

            case Notes.Ab4: return(415);

            case Notes.A4: return(440);

            case Notes.As4: return(466);

            case Notes.Bb4: return(466);

            case Notes.B4: return(494);

            case Notes.C5: return(523);

            case Notes.Cs5: return(554);

            case Notes.Db5: return(554);

            case Notes.D5: return(587);

            case Notes.Ds5: return(622);

            case Notes.Eb5: return(622);

            case Notes.E5: return(659);

            case Notes.F5: return(698);

            case Notes.Fs5: return(740);

            case Notes.Gb5: return(740);

            case Notes.G5: return(784);

            case Notes.Gs5: return(831);

            case Notes.Ab5: return(831);

            case Notes.A5: return(880);

            case Notes.As5: return(932);

            case Notes.Bb5: return(932);

            case Notes.B5: return(988);

            case Notes.C6: return(1047);

            case Notes.Cs6: return(1109);

            case Notes.Db6: return(1109);

            case Notes.D6: return(1175);

            case Notes.Ds6: return(1245);

            case Notes.Eb6: return(1245);

            case Notes.E6: return(1319);

            case Notes.F6: return(1397);

            case Notes.Fs6: return(1480);

            case Notes.Gb6: return(1480);

            case Notes.G6: return(1568);

            case Notes.Gs6: return(1661);

            case Notes.Ab6: return(1661);

            case Notes.A6: return(1760);

            case Notes.As6: return(1865);

            case Notes.Bb6: return(1865);

            case Notes.B6: return(1976);

            case Notes.C7: return(2093);

            case Notes.Cs7: return(2217);

            case Notes.Db7: return(2217);

            case Notes.D7: return(2349);

            case Notes.Ds7: return(2489);

            case Notes.Eb7: return(2489);

            case Notes.E7: return(2637);

            case Notes.F7: return(2794);

            case Notes.Fs7: return(2960);

            case Notes.Gb7: return(2960);

            case Notes.G7: return(3136);

            case Notes.Gs7: return(3322);

            case Notes.Ab7: return(3322);

            case Notes.A7: return(3520);

            case Notes.As7: return(3729);

            case Notes.Bb7: return(3729);

            case Notes.B7: return(3951);

            case Notes.C8: return(4186);

            case Notes.Cs8: return(4435);

            case Notes.Db8: return(4435);

            case Notes.D8: return(4699);

            case Notes.Ds8: return(4978);

            case Notes.Eb8: return(4978);

            default:
                return(0);
            }
        }
Exemplo n.º 47
0
 public Note(Notes note, uint Duration, uint Octave)
 {
     NoteType      = note;
     this.Duration = Duration;
     this.Octave   = Octave;
 }
 private void LoadNotes_TSW()
 {
     var item = new Notes();
     NotesDB.GetCommentsTSW(m_FromLive, Helper.ToInt32(lblTourID.Text));
     ddlCommentType.SelectedValue = item.NoteTypeID.ToString();
     TxtNotesBooked.Text = item.NoteDesc;
 }
Exemplo n.º 49
0
 public List <NoteArray> RandomNotes()
 {
     return(Notes.Select(x => new { n = x, rand = Utility.Random(Notes.Count) }).OrderBy(x => x.rand).Select(x => x.n).ToList());
 }
    void SaveNotesPMS(TextBox txtControl, bool parSystemNote, string parUserID)
    {
        Notes item = new Notes();
        item.FromLive = m_FromLive;
        item.ReservationNum = Helper.ToInt32(lblReservation.Text);
        item.SubReservationNum = Helper.ToInt32(hdnRSNO.Value);
        item.PCIID = parPCIID;
        item.HotelNumber = Helper.ToInt32(hdnHNDirectFromSIHOT.Value);
        item.NoteBy = parUserID;
        item.SystemNote = parSystemNote;
        //item.NoteDesc = txtComments.Text.Trim();

        item.NoteDesc = txtControl.Text.Trim();

        NotesDB.InsertTbl_Notes(item);
    }
Exemplo n.º 51
0
                public static IUIControl TryParseControl( Notes.BaseControl.CreateParams parentParams, XmlReader reader )
                {
                    // either create/parse a new control, or return null.
                    /*switch( reader.Name )
                    {
                        case "P":
                        case "Paragraph": return new Paragraph( parentParams, reader );

                        case "C":
                        case "Canvas": return new Canvas( parentParams, reader );

                        case "SP":
                        case "StackPanel": return new StackPanel( parentParams, reader );

                        case "L":
                        case "List": return new List( parentParams, reader );

                        case "LI":
                        case "ListItem": return new ListItem( parentParams, reader );

                        case "RB":
                        case "RevealBox": return new RevealBox( parentParams, reader );

                        case "Q":
                        case "Quote": return new Quote( parentParams, reader );

                        case "TI":
                        case "TextInput": return new TextInput( parentParams, reader );

                        case "H":
                        case "Header": return new Header( parentParams, reader );
                    }*/

                    if ( Paragraph.ElementTagMatches( reader.Name ) )
                    {
                        return new Paragraph( parentParams, reader );
                    }
                    else if ( Canvas.ElementTagMatches( reader.Name ) )
                    {
                        return new Canvas( parentParams, reader );
                    }
                    else if ( StackPanel.ElementTagMatches( reader.Name ) )
                    {
                        return new StackPanel( parentParams, reader );
                    }
                    else if ( List.ElementTagMatches( reader.Name ) )
                    {
                        return new List( parentParams, reader );
                    }
                    else if ( ListItem.ElementTagMatches( reader.Name ) )
                    {
                        return new ListItem( parentParams, reader );
                    }
                    else if ( RevealBox.ElementTagMatches( reader.Name ) )
                    {
                        return new RevealBox( parentParams, reader );
                    }
                    else if ( Quote.ElementTagMatches( reader.Name ) )
                    {
                        return new Quote( parentParams, reader );
                    }
                    else if ( TextInput.ElementTagMatches( reader.Name ) )
                    {
                        return new TextInput( parentParams, reader );
                    }
                    else if ( Header.ElementTagMatches( reader.Name ) )
                    {
                        return new Header( parentParams, reader );
                    }

                    throw new Exception( String.Format( "Control of type {0} does not exist.", reader.Name ) );
                }
 public async Task <ActionResult> SubmitNote(Notes notes)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 53
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HWPFDocument"/> class.
        /// </summary>
        /// <param name="directory">The directory.</param>
        public HWPFDocument(DirectoryNode directory)
            : base(directory)
        {
            _endnotes = new NotesImpl(_endnotesTables);
            _footnotes = new NotesImpl(_footnotesTables);

            // Load the main stream and FIB
            // Also handles HPSF bits

            // Do the CP Split
            _cpSplit = new CPSplitCalculator(_fib);

            // Is this document too old for us?
            if (_fib.GetNFib() < 106)
            {
                throw new OldWordFileFormatException("The document is too old - Word 95 or older. Try HWPFOldDocument instead?");
            }

            // use the fib to determine the name of the table stream.
            String name = "0Table";
            if (_fib.IsFWhichTblStm())
            {
                name = "1Table";
            }

            // Grab the table stream.
            DocumentEntry tableProps;
            try
            {
                tableProps =
                    (DocumentEntry)directory.GetEntry(name);
            }
            catch (FileNotFoundException)
            {
                throw new InvalidOperationException("Table Stream '" + name + "' wasn't found - Either the document is corrupt, or is Word95 (or earlier)");
            }

            // read in the table stream.
            _tableStream = new byte[tableProps.Size];
            directory.CreatePOIFSDocumentReader(name).Read(_tableStream);

            _fib.FillVariableFields(_mainStream, _tableStream);

            // read in the data stream.
            try
            {
                DocumentEntry dataProps =
                    (DocumentEntry)directory.GetEntry("Data");
                _dataStream = new byte[dataProps.Size];
                directory.CreatePOIFSDocumentReader("Data").Read(_dataStream);
            }
            catch (FileNotFoundException)
            {
                _dataStream = new byte[0];
            }

            // Get the cp of the start of text in the main stream
            // The latest spec doc says this is always zero!
            int fcMin = 0;
            //fcMin = _fib.GetFcMin()

            // Start to load up our standard structures.
            _dop = new DocumentProperties(_tableStream, _fib.GetFcDop());
            _cft = new ComplexFileTable(_mainStream, _tableStream, _fib.GetFcClx(), fcMin);
            TextPieceTable _tpt = _cft.GetTextPieceTable();


            // Now load the rest of the properties, which need to be adjusted
            //  for where text really begin
            _cbt = new CHPBinTable(_mainStream, _tableStream, _fib.GetFcPlcfbteChpx(), _fib.GetLcbPlcfbteChpx(), _tpt);
            _pbt = new PAPBinTable(_mainStream, _tableStream, _dataStream, _fib.GetFcPlcfbtePapx(), _fib.GetLcbPlcfbtePapx(), _tpt);

            _text = _tpt.Text;

            /*
 * in this mode we preserving PAPX/CHPX structure from file, so text may
 * miss from output, and text order may be corrupted
 */
            bool preserveBinTables = false;
            try
            {
                preserveBinTables = Boolean.Parse(
                    ConfigurationManager.AppSettings[PROPERTY_PRESERVE_BIN_TABLES]);
            }
            catch (Exception)
            {
                // ignore;
            }

            if (!preserveBinTables)
            {
                _cbt.Rebuild(_cft);
                _pbt.Rebuild(_text, _cft);
            }

            /*
             * Property to disable text rebuilding. In this mode changing the text
             * will lead to unpredictable behavior
             */
            bool preserveTextTable = false;
            try
            {
                preserveTextTable = Boolean.Parse(
                        ConfigurationManager.AppSettings[PROPERTY_PRESERVE_TEXT_TABLE]);
            }
            catch (Exception)
            {
                // ignore;
            }
            if (!preserveTextTable)
            {
                _cft = new ComplexFileTable();
                _tpt = _cft.GetTextPieceTable();
                TextPiece textPiece = new SinglentonTextPiece(_text);
                _tpt.Add(textPiece);
                _text = textPiece.GetStringBuilder();
            }

            // Read FSPA and Escher information
            // _fspa = new FSPATable(_tableStream, _fib.getFcPlcspaMom(),
            // _fib.getLcbPlcspaMom(), getTextTable().getTextPieces());
            _fspaHeaders = new FSPATable(_tableStream, _fib,
                    FSPADocumentPart.HEADER);
            _fspaMain = new FSPATable(_tableStream, _fib, FSPADocumentPart.MAIN);

            if (_fib.GetFcDggInfo() != 0)
            {
                _dgg = new EscherRecordHolder(_tableStream, _fib.GetFcDggInfo(), _fib.GetLcbDggInfo());
            }
            else
            {
                _dgg = new EscherRecordHolder();
            }

            // read in the pictures stream
            _pictures = new PicturesTable(this, _dataStream, _mainStream, _fspa, _dgg);
            // And the art shapes stream
            _officeArts = new ShapesTable(_tableStream, _fib);

            // And escher pictures
            _officeDrawingsHeaders = new OfficeDrawingsImpl(_fspaHeaders, _dgg, _mainStream);
            _officeDrawingsMain = new OfficeDrawingsImpl(_fspaMain, _dgg, _mainStream);

            _st = new SectionTable(_mainStream, _tableStream, _fib.GetFcPlcfsed(), _fib.GetLcbPlcfsed(), fcMin, _tpt, _cpSplit);
            _ss = new StyleSheet(_tableStream, _fib.GetFcStshf());
            _ft = new FontTable(_tableStream, _fib.GetFcSttbfffn(), _fib.GetLcbSttbfffn());

            int listOffset = _fib.GetFcPlcfLst();
            int lfoOffset = _fib.GetFcPlfLfo();
            if (listOffset != 0 && _fib.GetLcbPlcfLst() != 0)
            {
                _lt = new ListTables(_tableStream, _fib.GetFcPlcfLst(), _fib.GetFcPlfLfo());
            }

            int sbtOffset = _fib.GetFcSttbSavedBy();
            int sbtLength = _fib.GetLcbSttbSavedBy();
            if (sbtOffset != 0 && sbtLength != 0)
            {
                _sbt = new SavedByTable(_tableStream, sbtOffset, sbtLength);
            }

            int rmarkOffset = _fib.GetFcSttbfRMark();
            int rmarkLength = _fib.GetLcbSttbfRMark();
            if (rmarkOffset != 0 && rmarkLength != 0)
            {
                _rmat = new RevisionMarkAuthorTable(_tableStream, rmarkOffset, rmarkLength);
            }


            _bookmarksTables = new BookmarksTables(_tableStream, _fib);
            _bookmarks = new BookmarksImpl(_bookmarksTables);

            _endnotesTables = new NotesTables(NoteType.ENDNOTE, _tableStream, _fib);
            _endnotes = new NotesImpl(_endnotesTables);
            _footnotesTables = new NotesTables(NoteType.FOOTNOTE, _tableStream, _fib);
            _footnotes = new NotesImpl(_footnotesTables);

            _fieldsTables = new FieldsTables(_tableStream, _fib);
            _fields = new FieldsImpl(_fieldsTables);
        }
 public async Task <ActionResult> DeleteNotes(Notes notes)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 55
0
 //Сделать заметку о грядке
 public void AddNote(string notesToMake)
 {
     Notes.Add(notesToMake);
 }
Exemplo n.º 56
0
 /// <summary>
 /// Clones chord by creating a copy of it.
 /// </summary>
 /// <returns>Copy of the chord.</returns>
 public Chord Clone()
 {
     return(new Chord(Notes.Select(note => note.Clone())));
 }
    void SaveAutomaticNotesPMS(string parDesc)
    {
        Notes item = new Notes();
        item.ReservationNum = Helper.ToInt32(lblReservation.Text);
        item.SubReservationNum = Helper.ToInt32(hdnRSNO.Value);
        item.FromLive = m_FromLive;
        item.PCIID = parPCIID;
        item.HotelNumber = Helper.ToInt32(hdnHNDirectFromSIHOT.Value);
        item.NoteBy = varSystemUser;
        item.SystemNote = true;
        item.NoteDesc = parDesc;

        NotesDB.Insert_AutomaticNotes(item);
    }
Exemplo n.º 58
0
 public bool DeleteNote(string note)
 {
     return(Notes.Remove(note));
 }
    void SaveNotesTSW(DropDownList ddlControl, TextBox txtControl, bool parSystemNote)
    {
        Notes item = new Notes();
        item.FromLive = m_FromLive;
        item.SiteID=SiteId;
        //item.TourID = TourId;

        item.TourID = Convert.ToInt32(lblTourID.Text);

        item.NoteTypeID = Helper.ToInt32(ddlControl.SelectedValue);
        //item.NoteDesc = txtComments.Text.Trim();
        item.NoteDesc = txtControl.Text.Trim();
        item.NoteBy = txtUserIdNotes.Text.Trim();

        NotesDB.InsertTbl_NotesTSW(item);
    }
Exemplo n.º 60
0
 public void SetUp()
 {
     note = new Notes();
 }