コード例 #1
0
ファイル: SongRecorder.cs プロジェクト: Tuputi/DDA
        public static void AddNote(Direction direction, NoteType noteType)
        {
            var adjustment = TimePassed % SnappingScale;
            var exactTime = TimePassed - adjustment;

            Song.SongNotes.Add(new SongNote { Beat = exactTime, Direction = direction, NoteType = noteType});
        }
コード例 #2
0
ファイル: Note.cs プロジェクト: Baensi/Assets
 public Note(NoteType type, string captionId, string textId, bool active)
 {
     this.type = type;
     this.captionId = captionId;
     this.textId = textId;
     this.active = active;
 }
コード例 #3
0
ファイル: Score.cs プロジェクト: hjrhjr/Beats2
 public static AccuracyType GetAccuracyValue(float timeDiff, NoteType type)
 {
     float timeDiffAbs = (timeDiff > 0) ? (timeDiff) : (-timeDiff);
     switch (type) {
         case NoteType.TAP:
         case NoteType.HOLD:
         case NoteType.ROLL:
         case NoteType.SLIDE:
         case NoteType.REPEAT:
             if (timeDiffAbs <= SCORE_TIMING_FLAWLESS) {
                 return AccuracyType.FLAWLESS;
             } else if (timeDiffAbs <= SCORE_TIMING_PERFECT) {
                 return AccuracyType.PERFECT;
             } else if (timeDiffAbs <= SCORE_TIMING_GREAT) {
                 return AccuracyType.GREAT;
             } else if (timeDiffAbs <= SCORE_TIMING_GOOD) {
                 return AccuracyType.GOOD;
             } else if (timeDiffAbs <= SCORE_TIMING_BAD) {
                 return AccuracyType.BAD;
             } else {
                 if (timeDiff > SCORE_TIMING_BAD) {
                     return AccuracyType.MISS;
                 } else {
                     return AccuracyType.IGNORE;
                 }
             }
         default:
             Logger.Error("Scores.GetAccuracyValue", String.Format("Incorrect noteEvent \"{0}\"", type));
             return AccuracyType.IGNORE;
     }
 }
コード例 #4
0
ファイル: Note.cs プロジェクト: solymosi/mayor-ertesito
 public Note(int ID, string Grade, string Name, NoteType Type)
 {
     this.ID = ID;
     this.Grade = Grade;
     this.Name = Name;
     this.Type = Type;
 }
コード例 #5
0
ファイル: MidNote.cs プロジェクト: Nanook/TheGHOST
 internal MidNote(NoteType type, string section, int offset, int note)
 {
     Type = type;
     Section = section;
     Offset = offset;
     Note = note;
 }
コード例 #6
0
ファイル: Note.cs プロジェクト: doskir/Drumbot
 public Note(Rectangle rectangle,NoteType color,NoteType trackColor)
 {
     Rectangle = rectangle;
     Color = color;
     TrackColor = trackColor;
     TargetPoint = GetTargetPoint(TrackColor);
 }
コード例 #7
0
ファイル: Note.cs プロジェクト: KoHHeKT/symphony.net
		public Note(IPitchInfo pitchInfo, Duration duration, Notehead notehead = Notehead.Normal,
			int voice = 1, NoteType type = NoteType.Quarter)
		{
			PitchInfo = pitchInfo;
			Duration = duration;
			Notehead = notehead;
			Voice = voice;
			Type = type;
		}
コード例 #8
0
ファイル: KTransferOneFunction.cs プロジェクト: viticm/pap2
 public void ReInit(string strAll)
 {
     noteType = NoteType.NONE;
     m_strAllfuc = strAll;
     m_strFuncName = "";
     m_strParas = "";
     m_strReturn = "";
     Init();            
 }
コード例 #9
0
    public void ReleaseAllNotes()
    {
        water1 = NoteType.NULL;
        water2 = NoteType.NULL;
        water3 = NoteType.NULL;

        water1Sprite.color = new Color (1, 1, 1);
        water2Sprite.color = new Color (1, 1, 1);
        water3Sprite.color = new Color (1, 1, 1);
    }
コード例 #10
0
        public void Assure_the_default_type_of_a_note_is_positive()
        {
            Given("a new retrospective note is created", () =>
                  _note = new RetrospectiveNote());

            When("we fetch the type of the note", () =>
                 _type = _note.Type);

            Then("the note should be positive", () =>
                 _type.ShouldBe(NoteType.Positive));
        }
コード例 #11
0
 public void addNote(NoteType note)
 {
     if (water1.Equals(NoteType.NULL)) {
         water1 = note;
         water1Sprite.color = getColorFromNoteType(note);
     } else if (water2.Equals(NoteType.NULL)) {
         water2 = note;
         water2Sprite.color = getColorFromNoteType(note);
     } else if (water3.Equals(NoteType.NULL)) {
         water3 = note;
         water3Sprite.color = getColorFromNoteType(note);
     }
 }
コード例 #12
0
 public static Color getColorFromNoteType(NoteType type, byte alpha = 255)
 {
     if (type.Equals(NoteType.ONE)) {
         return new Color32(40,102,210, alpha);
     } else if (type.Equals(NoteType.TWO)) {
         return new Color32(37,208,64, alpha);
     } else if (type.Equals(NoteType.THREE)) {
         return new Color32(250,255,65, alpha);
     } else if (type.Equals(NoteType.FOUR)) {
         return new Color32(244,40,42, alpha);
     }
     return new Color (0,0,0, alpha);
 }
コード例 #13
0
ファイル: NoteTypes.ascx.cs プロジェクト: NewPointe/Rockit
        /// <summary>
        /// Handles the SaveClick event of the modalDetails control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        protected void modalDetails_SaveClick( object sender, EventArgs e )
        {
            int noteTypeId = 0;
            if ( hfIdValue.Value != string.Empty && !int.TryParse( hfIdValue.Value, out noteTypeId ) )
            {
                noteTypeId = 0;
            }

            var rockContext = new RockContext();
            var service = new NoteTypeService( rockContext );
            NoteType noteType = null;

            if ( noteTypeId != 0 )
            {
                noteType = service.Get( noteTypeId );
            }

            if ( noteType == null )
            {
                var orders = service.Queryable()
                    .Where( t => t.EntityTypeId == ( entityTypePicker.SelectedEntityTypeId ?? 0 ) )
                    .Select( t => t.Order )
                    .ToList();

                noteType = new NoteType();
                noteType.Order = orders.Any() ? orders.Max( t => t ) + 1 : 0;
                service.Add( noteType );
            }

            noteType.Name = tbName.Text;
            noteType.EntityTypeId = entityTypePicker.SelectedEntityTypeId ?? 0;
            noteType.EntityTypeQualifierColumn = "";
            noteType.EntityTypeQualifierValue = "";
            noteType.UserSelectable = cbUserSelectable.Checked;
            noteType.CssClass = tbCssClass.Text;
            noteType.IconCssClass = tbIconCssClass.Text;

            if ( noteType.IsValid )
            {
                rockContext.SaveChanges();

                NoteTypeCache.Flush( noteType.Id );
                NoteTypeCache.FlushEntityNoteTypes();

                hfIdValue.Value = string.Empty;
                modalDetails.Hide();

                BindFilter();
                BindGrid();
            }
        }
コード例 #14
0
 public PivotPage()
 {
     this.InitializeComponent();
     this.selectedPivot = NoteType.SimpleNote;
     this.NavigationCacheMode = NavigationCacheMode.Required;
     this.navigationHelper = new NavigationHelper(this);
     this.navigationHelper.LoadState += this.NavigationHelper_LoadState;
     this.navigationHelper.SaveState += this.NavigationHelper_SaveState;
     this.listViews[(int)NoteType.SimpleNote] = SimpleNotesList;
     this.listViews[(int)NoteType.TodoNote] = ToDoNotesList;
     this.listViews[(int)NoteType.PhotoNote] = PhotoNotesList;
     noteManagers.Add(new SimpleNoteManager());
     noteManagers.Add(new TodoNoteManager());
     noteManagers.Add(new PhotoNoteManager());
 }
コード例 #15
0
ファイル: NoteType.cs プロジェクト: huming2207/ghgame
 public bool isEqual(NoteType other)
 {
     if ((Green == other.Green) &&
         (Red == other.Red) &&
         (Yellow == other.Yellow) &&
         (Blue == other.Blue) &&
         (Orange == other.Orange))
     {
         return true;
     }
     else
     {
         return false;
     }
 }
コード例 #16
0
ファイル: Note.cs プロジェクト: aopell/MusicMaker
        public static void Play(NoteCode name, NoteType length)
        {
            int noteValue = Convert.ToInt32(length);

            if(noteValue < 0 && !stop)
            {
                System.Threading.Thread.Sleep(Math.Abs(noteValue));
            }
            else if (noteValue >= 0 && !stop)
            {
                Console.Beep(ConvertToHertz(name), noteValue);
            }
            else
            {
                return;
            }
        }
コード例 #17
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Init" /> event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs" /> object that contains the event data.</param>
        protected override void OnInit( EventArgs e )
        {
            base.OnInit( e );

            var contextEntity = this.ContextEntity();
            if ( contextEntity != null )
            {
                string noteTypeName = GetAttributeValue( "NoteType" );

                var rockContext = new RockContext();
                var service = new NoteTypeService( rockContext );
                var noteType = service.Get( contextEntity.TypeId, noteTypeName );

                // If a note type with the specified name does not exist for the context entity type, create one
                if ( noteType == null )
                {
                    noteType = new NoteType();
                    noteType.IsSystem = false;
                    noteType.EntityTypeId = contextEntity.TypeId;
                    noteType.EntityTypeQualifierColumn = string.Empty;
                    noteType.EntityTypeQualifierValue = string.Empty;
                    noteType.Name = noteTypeName;
                    service.Add( noteType );
                    rockContext.SaveChanges();
                }

                notesTimeline.NoteTypeId = noteType.Id;
                notesTimeline.EntityId = contextEntity.Id;
                notesTimeline.Title = GetAttributeValue( "Heading" );
                if ( string.IsNullOrWhiteSpace( notesTimeline.Title ) )
                {
                    notesTimeline.Title = noteType.Name;
                }
                notesTimeline.TitleIconCssClass = GetAttributeValue( "HeadingIcon" );
                notesTimeline.Term = GetAttributeValue( "NoteTerm" );
                notesTimeline.DisplayType = GetAttributeValue( "DisplayType" ) == "Light" ? NoteDisplayType.Light : NoteDisplayType.Full;
                notesTimeline.UsePersonIcon = GetAttributeValue( "UsePersonIcon" ).AsBoolean();
                notesTimeline.ShowAlertCheckBox = GetAttributeValue( "ShowAlertCheckbox" ).AsBoolean();
                notesTimeline.ShowPrivateCheckBox = GetAttributeValue( "ShowPrivateCheckbox" ).AsBoolean();
                notesTimeline.ShowSecurityButton = GetAttributeValue( "ShowSecurityButton" ).AsBoolean();
                notesTimeline.AllowAnonymousEntry = GetAttributeValue( "Allow Anonymous" ).AsBoolean();
                notesTimeline.AddAlwaysVisible = GetAttributeValue( "AddAlwaysVisible" ).AsBoolean();
                notesTimeline.SortDirection = GetAttributeValue( "DisplayOrder" ) == "Ascending" ? ListSortDirection.Ascending : ListSortDirection.Descending;
            }
        }
コード例 #18
0
ファイル: Note.cs プロジェクト: reznet/S3MParser
 public Note(int value)
 {
     switch (value)
     {
         case 255:
             this.Type = NoteType.Empty;
             break;
         case 254:
             this.Type = NoteType.NoteOff;
             break;
         default:
             this.Type = NoteType.Pitched;
             break;
     }
     if (this.Type == NoteType.Pitched)
     {
         this.Octave = 1 + (value >> 4);
         this.Pitch = pitches[value & 15];
     }
 }
コード例 #19
0
ファイル: FakeOutput.cs プロジェクト: doskir/Drumbot
 public void HitNote(NoteType color)
 {
     switch (color)
     {
         case NoteType.Red:
             RedHit = true;
             break;
         case NoteType.Yellow:
             YellowHit = true;
             break;
         case NoteType.Blue:
             BlueHit = true;
             break;
         case NoteType.Green:
             GreenHit = true;
             break;
         case NoteType.Orange:
             OrangeHit = true;
             break;
     }
 }
コード例 #20
0
ファイル: Game.cs プロジェクト: tonylambert/musicnotes
        public ScoreResult ScoreUserInput( NoteType userEnteredNote, NoteType noteType )
        {
            int pointsScored = _gameConfig.PointsGainedWhenCorrect;
             ScoreResult result = ScoreResult.Correct;

             if ( userEnteredNote != noteType && _currentNoteLocation != _gameConfig.PositionOfTargetArea )
             {
            pointsScored = _gameConfig.PointsLostWhenWrongNoteAndTime;
            result = ScoreResult.WrongTimeAndNote;
             }
             else if ( userEnteredNote != noteType )
             {
            pointsScored = _gameConfig.PointsLostWhenWrongNote;
            result = ScoreResult.WrongNote;
             }
             else if ( _currentNoteLocation != _gameConfig.PositionOfTargetArea )
             {
            pointsScored = _gameConfig.PointsLostWhenWrongTime;
            result = ScoreResult.WrongTime;
             }

             _totalScore += pointsScored;
             return result;
        }
コード例 #21
0
        public static decimal NoteTypeToFraction(NoteType noteType)
        {
            switch (noteType)
            {
                case NoteType.Whole:
                    return 1;
                case NoteType.Half:
                    return (decimal)0.5;
                case NoteType.Quarter:
                    return (decimal)0.25;
                case NoteType.Eighth:
                    return (decimal)1 / 8;
                case NoteType.Sixteenth:
                    return (decimal)1 / 16;
                case NoteType.ThirtySecond:
                    return (decimal)1 / 32;
                case NoteType.SixtyFourth:
                    return (decimal)1 / 64;
                case NoteType.HundredTwentyEighth:
                    return (decimal)1 / 128;
                case NoteType.TwoHundredAndSixtyFifth:
                    return (decimal)1 / 256;
            }

            return 1;
        }
コード例 #22
0
        private void GetNoteType()
        {
            string noteTypeName = GetAttributeValue( "NoteType" );

            var service = new NoteTypeService();
            noteType = service.Get( contextEntity.TypeId, noteTypeName );

            // If a note type with the specified name does not exist for the context entity type, create one
            if ( noteType == null )
            {
                noteType = new NoteType();
                noteType.IsSystem = false;
                noteType.EntityTypeId = contextEntity.TypeId;
                noteType.EntityTypeQualifierColumn = string.Empty;
                noteType.EntityTypeQualifierValue = string.Empty;
                noteType.Name = noteTypeName;
                service.Add( noteType, CurrentPersonId );
                service.Save( noteType, CurrentPersonId );
            }
        }
コード例 #23
0
ファイル: Notes.cs プロジェクト: NewSpring/Excavator
        /// <summary>
        /// Maps the notes.
        /// </summary>
        /// <param name="tableData">The table data.</param>
        public void MapNotes( IQueryable<Row> tableData )
        {
            var lookupContext = new RockContext();
            var categoryService = new CategoryService( lookupContext );
            var personService = new PersonService( lookupContext );

            var noteTypes = new NoteTypeService( lookupContext ).Queryable().AsNoTracking().ToList();
            var personalNoteType = noteTypes.FirstOrDefault( nt => nt.Guid == new Guid( Rock.SystemGuid.NoteType.PERSON_TIMELINE_NOTE ) );

            var importedUsers = new UserLoginService( lookupContext ).Queryable().AsNoTracking()
                .Where( u => u.ForeignId != null )
                .ToDictionary( t => t.ForeignId, t => t.PersonId );

            var noteList = new List<Note>();

            int completed = 0;
            int totalRows = tableData.Count();
            int percentage = ( totalRows - 1 ) / 100 + 1;
            ReportProgress( 0, string.Format( "Verifying note import ({0:N0} found).", totalRows ) );
            foreach ( var row in tableData.Where( r => r != null ) )
            {
                string text = row["Note_Text"] as string;
                int? individualId = row["Individual_ID"] as int?;
                int? householdId = row["Household_ID"] as int?;
                var noteTypeActive = row["NoteTypeActive"] as Boolean?;

                bool noteArchived = false;
                if ( row.Columns.FirstOrDefault( v => v.Name.Equals( "IsInactive" ) ) != null )
                {
                    /* =====================================================================
                    *  the NoteArchived column *should* work, but OrcaMDF won't read it...
                    *  instead check for a manually added column: IsInactive int null
                    *       var noteActive = row["NoteArchived"] as Boolean?;
                    *       if ( noteActive == null ) throw new NullReferenceException();
                    /* ===================================================================== */
                    var rowInactiveValue = row["IsInactive"] as int?;
                    noteArchived = rowInactiveValue.Equals( 1 );
                }

                var personKeys = GetPersonKeys( individualId, householdId );
                if ( personKeys != null && !string.IsNullOrWhiteSpace( text ) && noteTypeActive == true && !noteArchived )
                {
                    DateTime? dateCreated = row["NoteCreated"] as DateTime?;
                    string noteType = row["Note_Type_Name"] as string;

                    var note = new Note();
                    note.CreatedDateTime = dateCreated;
                    note.EntityId = personKeys.PersonId;

                    // These replace methods don't like being chained together
                    text = Regex.Replace( text, @"\t|\&nbsp;", " " );
                    text = text.Replace( "&#45;", "-" );
                    text = text.Replace( "&lt;", "<" );
                    text = text.Replace( "&gt;", ">" );
                    text = text.Replace( "&amp;", "&" );
                    text = text.Replace( "&quot;", @"""" );
                    text = text.Replace( "&#x0D", string.Empty );

                    note.Text = text.Trim();

                    int? userId = row["NoteCreatedByUserID"] as int?;
                    if ( userId != null && importedUsers.ContainsKey( userId ) )
                    {
                        var userKeys = ImportedPeople.FirstOrDefault( p => p.PersonId == (int)importedUsers[userId] );
                        if ( userKeys != null )
                        {
                            note.CreatedByPersonAliasId = userKeys.PersonAliasId;
                        }
                    }

                    int? matchingNoteTypeId = null;
                    if ( !noteType.StartsWith( "General", StringComparison.InvariantCultureIgnoreCase ) )
                    {
                        matchingNoteTypeId = noteTypes.Where( nt => nt.Name == noteType ).Select( i => (int?)i.Id ).FirstOrDefault();
                    }
                    else
                    {
                        matchingNoteTypeId = personalNoteType.Id;
                    }

                    if ( matchingNoteTypeId != null )
                    {
                        note.NoteTypeId = (int)matchingNoteTypeId;
                    }
                    else
                    {
                        // create the note type
                        var newNoteType = new NoteType();
                        newNoteType.EntityTypeId = personalNoteType.EntityTypeId;
                        newNoteType.EntityTypeQualifierColumn = string.Empty;
                        newNoteType.EntityTypeQualifierValue = string.Empty;
                        newNoteType.UserSelectable = true;
                        newNoteType.IsSystem = false;
                        newNoteType.Name = noteType;
                        newNoteType.Order = 0;

                        lookupContext.NoteTypes.Add( newNoteType );
                        lookupContext.SaveChanges( DisableAuditing );

                        noteTypes.Add( newNoteType );
                        note.NoteTypeId = newNoteType.Id;
                    }

                    noteList.Add( note );
                    completed++;

                    if ( completed % percentage < 1 )
                    {
                        int percentComplete = completed / percentage;
                        ReportProgress( percentComplete, string.Format( "{0:N0} notes imported ({1}% complete).", completed, percentComplete ) );
                    }
                    else if ( completed % ReportingNumber < 1 )
                    {
                        SaveNotes( noteList );
                        ReportPartialProgress();
                        noteList.Clear();
                    }
                }
            }

            if ( noteList.Any() )
            {
                SaveNotes( noteList );
            }

            ReportProgress( 100, string.Format( "Finished note import: {0:N0} notes imported.", completed ) );
        }
コード例 #24
0
ファイル: Note.cs プロジェクト: lsalamon/solution2010
 /// <summary>
 /// 
 /// </summary>
 /// <param name="text"></param>
 /// <param name="type"></param>
 public Note(string text, NoteType type)
     : this(type)
 {
     this.Value = text;
 }
コード例 #25
0
ファイル: Note.cs プロジェクト: Baensi/Assets
 public Note(NoteType type, string captionId, string textId)
     : this(type, captionId, textId, true)
 {
 }
コード例 #26
0
ファイル: Note.cs プロジェクト: lsalamon/solution2010
 /// <summary>
 /// 
 /// </summary>
 /// <param name="type"></param>
 public Note(NoteType type)
     : this()
 {
     this.Type = type;
 }
コード例 #27
0
ファイル: NotificationManager.cs プロジェクト: brooke/grogre
 public Notification(PrizeType p_prize)
 {
     noteType = NoteType.DISCOVERY;
     prize = p_prize;
 }
コード例 #28
0
ファイル: NotificationManager.cs プロジェクト: brooke/grogre
 public Notification(BaddyType p_monster)
 {
     noteType = NoteType.ENCOUNTER;
     monster = p_monster;
 }
コード例 #29
0
ファイル: NotificationManager.cs プロジェクト: brooke/grogre
 public Notification(NoteType p_noteType)
 {
     noteType = p_noteType;
 }
コード例 #30
0
ファイル: NotificationManager.cs プロジェクト: brooke/grogre
 string textureFor(NoteType nType)
 {
     if (nType == NoteType.ENCOUNTER)
         return "encounter";
     //if (nType == NoteType.DISCOVERY)
         return "discovery";
 }