/// <summary> /// Creates a new instance of Content. /// </summary> /// <param name="basePath">Path to client directory.</param> /// <param name="device">A GraphicsDevice instance.</param> private Content(string basePath, GraphicsDevice device) { this.BasePath = basePath; this.Device = device; Changes = new ChangeManager(); UIGraphics = new UIGraphicsProvider(this, Device); AvatarMeshes = new AvatarMeshProvider(this, Device); AvatarBindings = new AvatarBindingProvider(this); AvatarTextures = new AvatarTextureProvider(this, Device); AvatarSkeletons = new AvatarSkeletonProvider(this); AvatarAppearances = new AvatarAppearanceProvider(this); AvatarOutfits = new AvatarOutfitProvider(this); AvatarAnimations = new AvatarAnimationProvider(this); AvatarPurchasables = new AvatarPurchasables(this); AvatarHandgroups = new HandgroupProvider(this, Device); AvatarThumbnails = new AvatarThumbnailProvider(this, Device); WorldObjects = new WorldObjectProvider(this); WorldFloors = new WorldFloorProvider(this); WorldWalls = new WorldWallProvider(this); WorldObjectGlobals = new WorldGlobalProvider(this); WorldCatalog = new WorldObjectCatalog(); Audio = new Audio(this); GlobalTuning = new Tuning(Path.Combine(basePath, "tuning.dat")); Init(); }
private static TuningEditorViewModel CopyExistingTuning(Tuning tuning, Instrument targetInstrument) { if (null == tuning) { throw new ArgumentNullException("tuning"); } if (null == targetInstrument) { throw new ArgumentNullException("targetInstrument"); } TuningEditorViewModel tuningEditorVM = new TuningEditorViewModel(true, false, (name, notes) => { FullNote[] rootNotes = new FullNote[notes.Count]; for (int i = 0; i < notes.Count; i++) { rootNotes[i] = notes[i].FullNote; } targetInstrument.Tunings.Add(name, rootNotes); }); tuningEditorVM.Name = tuning.Name; foreach (FullNote note in tuning.RootNotes) { tuningEditorVM.RootNotes.Add(new ObservableNote(note.Clone())); } return(tuningEditorVM); }
public override void CheckPureTuning() { if (GameController == null) { return; } if (new[] { "DM", "TDM", "CTF" }.Contains(GameController.GameType)) { var error = false; foreach (var pair in Tuning) { if (pair.Value.Value != pair.Value.DefaultValue) { error = true; break; } } if (error) { Tuning.Reset(); Console.Print(OutputLevel.STANDARD, "server", "resetting tuning due to pure server"); } } }
private void ParseScorePart(IXmlNode element) { string id = element.GetAttribute("id"); var track = new Track(); _trackById[id] = track; _score.AddTrack(track); element.IterateChildren(c => { if (c.NodeType == XmlNodeType.Element) { switch (c.LocalName) { case "part-name": track.Name = Std.GetNodeValue(c.FirstChild); break; case "part-abbreviation": track.ShortName = Std.GetNodeValue(c.FirstChild); break; case "midi-instrument": ParseMidiInstrument(c, track); break; } } }); if (track.Tuning == null || track.Tuning.Length == 0) { track.Tuning = Tuning.GetDefaultTuningFor(6).Tunings; } }
public void LoadGame() { if (!File.Exists(filePath)) { return; } BinaryFormatter bf = new BinaryFormatter(); //open file for write varibale FileStream fs = new FileStream(filePath, FileMode.Open); Save save = (Save)bf.Deserialize(fs); Tuning tuning = GetComponent <Tuning>(); CarSpawnerTest carSpawn = GetComponent <CarSpawnerTest>(); if (tuning) { tuning.LoadData(save); } if (carSpawn) { carSpawn.LoadData(save); } //close file fs.Close(); }
public TuningInfo(TabFile tabFile, Tuning tuning, string name, string[] notes) { TabFile = tabFile; Tuning = tuning; Name = name; Notes = notes; }
public void SetValues(Tuning tuning) { if (tuning.Volume >= 0) { Volume = tuning.Volume; } if (tuning.Pitch >= 0) { Pitch = tuning.Pitch; } if (tuning.Range >= 0) { Range = tuning.Range; } if (tuning.Speed >= 0) { Speed = tuning.Speed; } pause.Long = tuning.pause.Long >= 0 ? tuning.pause.Long : pause.Long; pause.Middle = tuning.pause.Middle >= 0 ? tuning.pause.Middle : pause.Middle; pause.Sentence = tuning.pause.Sentence >= 0 ? tuning.pause.Sentence : pause.Sentence; if (tuning.Style != null) { Style = tuning.Style; } }
private void CreateGlyphs(Tuning tuning) { // Name AddGlyph(new TextGlyph(0, 0, tuning.Name, _resources.EffectFont)); Height += 15 * _scale; if (!tuning.IsStandard) { // Strings var stringsPerColumn = (int)Math.Ceiling(tuning.Tunings.Length / 2.0); var currentX = 0f; var currentY = Height; for (int i = 0, j = tuning.Tunings.Length; i < j; i++) { var str = "(" + (i + 1) + ") = " + Tuning.GetTextForTuning(tuning.Tunings[i], false); AddGlyph(new TextGlyph(currentX, currentY, str, _resources.EffectFont)); currentY += Height; if (i == stringsPerColumn - 1) { currentY = Height; currentX += (43 * _scale); } } Height += (stringsPerColumn * (15 * _scale)); } }
public TuningGlyph(float x, float y, float scale, RenderingResources resources, Tuning tuning) : base(x, y) { _scale = scale; _resources = resources; CreateGlyphs(tuning); }
public ObservableTuning(Tuning tuning) { if (null == tuning) { throw new ArgumentNullException("tuning"); } Tuning = tuning; }
/// <summary> /// Find the tuning for the instrument by the instrument and tuning name passed in. /// </summary> /// <param name="instrument">The instrument object.</param> /// <param name="tuning">The tuning name.</param> /// <returns>The tuning object.</returns> private Tuning GetTheTuning(Instrument instrument, string tuning) { Tuning myTuning = (from t in instrument.Tunings where t.LongName.ToUpper() == tuning.ToUpper() select t).FirstOrDefault(); return(myTuning); }
// Constructor internal EventHandlerDelegate(PlaybackSession session, Tuning tuning, OverlaySurface overlaySurface, UserInterface userInterface) { _tuning = tuning; _session = session; _overlaySurface = overlaySurface; _userInterface = userInterface; _eKeyboardHandler = null; _eChannelChangeHandler = null; }
public IEnumerable <NeckString> GetTuning(Tuning tuning) { switch (tuning) { case Tuning.EStandard: default: return(EStandardTuning); } }
/// <summary> /// Build an Instrument String for each Note in a Tuning. /// InstrumentStrings must be reversed because Fretboard must be viewed "upside-down" to adhere to view from player's perspective. /// </summary> private void PopulateFretboard() { foreach (Note note in Tuning.ReturnNotes()) { InstrumentStrings.Add(new InstrumentString(note, FretCount)); } InstrumentStrings.Reverse(); }
public void TestTuning() { var tex = @"\tuning E4 B3 G3 D3 A2 E2 . 0.5.1"; var score = ParseTex(tex); Assert.AreEqual(string.Join(",", Tuning.GetDefaultTuningFor(6).Tunings), string.Join(",", score.Tracks[0].Staves[0].Tuning)); }
public ConduitFlowVisualizer(ConduitFlow flow_manager, Game.ConduitVisInfo vis_info, string overlay_sound, Tuning tuning) { flowManager = flow_manager; visInfo = vis_info; overlaySound = overlay_sound; this.tuning = tuning; movingBallMesh = new ConduitFlowMesh(); staticBallMesh = new ConduitFlowMesh(); RenderMeshTask.Ball.InitializeResources(); }
public IEnumerable <NeckString> GetAllNotesOfNeck(Tuning tuning) { var roots = _tuningRepository.GetTuning(tuning); var fretStrings = new List <NeckString>(); foreach (var root in roots) { fretStrings.Add(GetAllNotesOfString(root)); } return(fretStrings); }
public void SetTuning(Tuning tuning) { if (tuning.Pitch >= 0) { ttsParam.Speaker[0].pitch = Range(0.5f, 2f, tuning.Pitch); } if (tuning.Volume >= 0) { ttsParam.Speaker[0].volume = Range(0f, 5f, tuning.Volume); } if (tuning.Range >= 0) { ttsParam.Speaker[0].range = Range(0f, 2f, tuning.Range); } if (tuning.Speed >= 0) { ttsParam.Speaker[0].speed = Range(0.5f, 4f, tuning.Speed); } if (tuning.pause.Middle >= 0) { ttsParam.Speaker[0].pauseMiddle = Range(80, 500, tuning.pause.Middle); } if (tuning.pause.Long >= 0) { ttsParam.Speaker[0].pauseLong = Range(100, 2000, tuning.pause.Long); } if (tuning.pause.Sentence >= 0) { ttsParam.Speaker[0].pauseSentence = Range(0, 10000, tuning.pause.Sentence); } if (tuning.Style != null) { ttsParam.Speaker[0].styleRate = tuning.Style; } ttsParam.Speaker[0].pauseLong = Math.Max(ttsParam.Speaker[0].pauseLong, ttsParam.Speaker[0].pauseMiddle); ttsParam.Speaker[0].pauseSentence = Math.Max(ttsParam.Speaker[0].pauseSentence, ttsParam.Speaker[0].pauseLong); IntPtr ptr = AITalkMarshal.TTtsParamToIntPtr(ref ttsParam); // Marshal.WriteInt32(ptr, 500); // TTtsParamToIntPtrメソッドは、先頭にサイズを書き込んである。(構造体の定義になってるから当たり前) code = AITalkAPI.SetParam(ptr); if (code != AITalkResultCode.AITALKERR_SUCCESS) { throw new Exception("パラメータ設定に失敗: "); } }
private void CreateScoreInfoGlyphs() { Logger.Info("ScoreLayout", "Creating score info glyphs"); var flags = Renderer.Settings.Layout.Get("hideInfo", false) ? HeaderFooterElements.None : HeaderFooterElements.All; var score = Renderer.Score; var res = Renderer.RenderingResources; ScoreInfoGlyphs = new FastDictionary <HeaderFooterElements, TextGlyph>(); if (!string.IsNullOrEmpty(score.Title) && (flags & HeaderFooterElements.Title) != 0) { ScoreInfoGlyphs[HeaderFooterElements.Title] = new TextGlyph(0, 0, score.Title, res.TitleFont, TextAlign.Center); } if (!string.IsNullOrEmpty(score.SubTitle) && (flags & HeaderFooterElements.SubTitle) != 0) { ScoreInfoGlyphs[HeaderFooterElements.SubTitle] = new TextGlyph(0, 0, score.SubTitle, res.SubTitleFont, TextAlign.Center); } if (!string.IsNullOrEmpty(score.Artist) && (flags & HeaderFooterElements.Artist) != 0) { ScoreInfoGlyphs[HeaderFooterElements.Artist] = new TextGlyph(0, 0, score.Artist, res.SubTitleFont, TextAlign.Center); } if (!string.IsNullOrEmpty(score.Album) && (flags & HeaderFooterElements.Album) != 0) { ScoreInfoGlyphs[HeaderFooterElements.Album] = new TextGlyph(0, 0, score.Album, res.SubTitleFont, TextAlign.Center); } if (!string.IsNullOrEmpty(score.Music) && score.Music == score.Words && (flags & HeaderFooterElements.WordsAndMusic) != 0) { ScoreInfoGlyphs[HeaderFooterElements.WordsAndMusic] = new TextGlyph(0, 0, "Music and Words by " + score.Words, res.WordsFont, TextAlign.Center); } else { if (!string.IsNullOrEmpty(score.Music) && (flags & HeaderFooterElements.Music) != 0) { ScoreInfoGlyphs[HeaderFooterElements.Music] = new TextGlyph(0, 0, "Music by " + score.Music, res.WordsFont, TextAlign.Right); } if (!string.IsNullOrEmpty(score.Words) && (flags & HeaderFooterElements.Words) != 0) { ScoreInfoGlyphs[HeaderFooterElements.Words] = new TextGlyph(0, 0, "Words by " + score.Music, res.WordsFont, TextAlign.Left); } } // tuning info if (Renderer.Tracks.Length == 1 && !Renderer.Tracks[0].IsPercussion) { var tuning = Tuning.FindTuning(Renderer.Tracks[0].Tuning); if (tuning != null) { TuningGlyph = new TuningGlyph(0, 0, Scale, Renderer.RenderingResources, tuning); } } }
private void RemoveSnapshot_Click(object sender, RoutedEventArgs e) { int index = uiSnapshots.SelectedIndex; foreach (var item in snapshots) { item.Value.RemoveAt(index); } uiSnapshots.Items.RemoveAt(index); uiSnapshots.SelectedIndex = Math.Min(index, uiSnapshots.Items.Count - 1); Tuning?.Invoke(this, EventArgs.Empty); }
/// <summary> /// Initializes the song with some required default values. /// </summary> /// <returns></returns> private void CreateDefaultScore() { _score = new Score(); _score.Tempo = 120; _score.TempoLabel = ""; _track = new Track(1); _track.PlaybackInfo.Program = 25; _track.PlaybackInfo.PrimaryChannel = TrackChannels[0]; _track.PlaybackInfo.SecondaryChannel = TrackChannels[1]; _track.Tuning = Tuning.GetDefaultTuningFor(6).Tunings; _score.AddTrack(_track); }
public VoltronConnectionLifecycleHandler(ISessions sessions, IDataService dataService, IDAFactory da, CityServerContext context, LotServerPicker lotServers, CityLivenessEngine engine, EventSystem events, Neighborhoods neigh, Tuning tuning) { this.VoltronSessions = sessions.GetOrCreateGroup(Groups.VOLTRON); this.Sessions = sessions; this.DataService = dataService; this.DAFactory = da; this.Context = context; this.LotServers = lotServers; this.Liveness = engine; this.Events = events; this.Neigh = neigh; this.TuningDomain = tuning; }
// Constructor internal UserInterface(ItvApp.AddIn addin) { _addin = addin; _overlaySurface = _addin.OverlaySurface; _videoSurface = _addin.VideoSurface; _tuning = _addin.Tuning; _session = _addin.Session; // create the object to receive keyboard hits. _eventHandler = new EventHandlerDelegate(_session, _tuning, _overlaySurface, this); // create a new audiostreamswticher _audioStreamSwitcher = new AudioStreamSwitcher(addin); }
public void TestStandard() { var standard = Tuning.GetDefaultTuningFor(6); var tuningText = new[] { "E4", "B3", "G3", "D3", "A2", "E2" }; var tuning = new int[tuningText.Length]; var tuningText2 = new string[tuningText.Length]; for (int i = 0; i < tuningText.Length; i++) { tuning[i] = TuningParser.GetTuningForText(tuningText[i]); tuningText2[i] = Tuning.GetTextForTuning(tuning[i], true); } Assert.AreEqual(string.Join(",", standard.Tunings), string.Join(",", tuning)); Assert.AreEqual(string.Join(",", tuningText), string.Join(",", tuningText2)); }
internal void Refresh(Instrument selectedInstrument = null, Tuning selectedTuning = null) { DefaultInstruments = AppVM.GetDefaultInstruments(); UserInstruments = AppVM.GetUserInstruments(); if (null == selectedInstrument) { SelectedInstrument = null; } else { foreach (ObservableInstrument oi in UserInstruments) { if (oi.Instrument == selectedInstrument) { SelectedInstrument = oi; break; } } if (null != SelectedInstrument) { foreach (ObservableInstrument oi in DefaultInstruments) { if (oi.Instrument == selectedInstrument) { SelectedInstrument = oi; break; } } } if (null != SelectedInstrument && null != selectedTuning) { foreach (ObservableTuning ot in Tunings) { if (ot.Tuning == selectedTuning) { SelectedTuning = ot; break; } } } } }
/// <summary> /// Call from JQuery to find the chords. /// </summary> /// <param name="instrument">The instrument.</param> /// <param name="tuning">The tuning.</param> /// <param name="notes">The root note for the chord.</param> /// <param name="chordQualities">The chord qualities.</param> /// <param name="numFrets">The number of frets to display.</param> /// <param name="maxFrets">The maximum number of frets to use.</param> /// <param name="maxReach">The maximum fret reach for the fingers.</param> /// <param name="autoAddBarres">Auto add barres?</param> /// <param name="allowOpenStrings">Allow open strings?</param> /// <param name="allowMutedStrings">Allow muted strings?</param> /// <param name="mirrorResults">Mirror the results for left-handed chords?</param> /// <param name="allowRootlessChords">Allow rootless chords?</param> /// <returns>List of SVG images to display in the UI.</returns> public JsonResult FindChords(string instrument, string tuning, string notes, string chordQualities, string numFrets, string maxFrets, string maxReach, string autoAddBarres, string allowOpenStrings, string allowMutedStrings, string mirrorResults, string allowRootlessChords) { // Initialize the ConfigFile object. InitConfig(); // Define the objects. Instrument Instrument = null; ChordQuality ChordQuality = null; ChordFinderOptions myOptions = null; ChordFinder chordFinder = null; ChordResultSet chordResultSet = null; ChordOptions chordOptions = null; Tuning Tuning = null; Note myNote = NoteUtils.ParseNote(notes); Instrument = GetAnInstrument(instrument); ChordQuality = GetChordQuality(chordQualities); if (Instrument != null) { // Instantiate the selected tuning object from the instrument. Tuning = GetTheTuning(Instrument, tuning); // Instantiate the chord finder options. myOptions = BuildChordFinderOptions(instrument, tuning, numFrets, maxFrets, maxReach, autoAddBarres, allowOpenStrings, allowMutedStrings, mirrorResults, allowRootlessChords); // Instantiate the chord finder object. chordFinder = new ChordFinder(Instrument, Tuning); // Instantiate the chord result set. chordResultSet = chordFinder.FindChords(myNote, ChordQuality, myOptions); // Instantiate the chord options. chordOptions = BuildChordOptions(); // Build the list of SVG images to return to the screen. return(Json(BuildSVGList(chordResultSet, chordOptions), JsonRequestBehavior.AllowGet)); } else { // The instrument doesn't exist. return(Json(String.Empty, JsonRequestBehavior.AllowGet)); } }
// Initilize method to uninitialize the members public void Uninitialize() { _description = null; // delete the overlaySurface. if (null != _overlaySurface) { _overlaySurface.Visible = false; _overlaySurface.Free(); _overlaySurface = null; } if (null != _videoSurface) { _videoSurface = null; } // remove the Tuning object if (null != _tuning) { _tuning = null; } // remove the event handler object if (null != _eventHandler) { _eventHandler.UnInitialize(); _eventHandler = null; } // delete the session object if (null != _session) { _session = null; } // delete the AudioStreamSwitcher if (null != _audioStreamSwitcher) { _audioStreamSwitcher.Uninitialize(); _audioStreamSwitcher = null; } }
private void Viewport_MouseUp(object sender, MouseButtonEventArgs e) { if (uiSnapshots.Items.Count == 0) { AddSnapshot_Click(this, e); uiSnapshots.SelectedIndex = 0; } int index = uiSnapshots.SelectedIndex; if (index >= 0) { snapshots[index] = uiCamera.Transform.Value; uiSnapshots.Items[index] = DateTime.Now.ToLongTimeString(); uiSnapshots.SelectedIndex = index; } Tuning?.Invoke(this, e); }
protected virtual void ConsoleTune(ConsoleCommandResult result, int clientId, ref object data) { var name = (string)result[0]; var param = Tuning.Contains(name) ? Tuning[name] : null; if (param == null) { Console.Print(OutputLevel.Standard, "tuning", "No such tuning parameter"); return; } if (result.ArgumentsCount == 2) { param.FloatValue = (int)result[1]; SendTuningParams(-1); } Console.Print(OutputLevel.Standard, "tuning", $"{name} = {param.FloatValue}"); }
public IEnumerable <NeckString> AddScale(string key, ScaleName scale, Tuning tuning) { key = key?.ToUpper(); ValidateNoteExists(key); var scaleNotes = _scaleRepository.GetNotesOfScale(key, scale); var neckStrings = _neckService.GetAllNotesOfNeck(tuning); foreach (var neckString in neckStrings) { foreach (var stringNote in neckString.Notes) { if (scaleNotes.Any(n => n.Name == stringNote.Note.Trim())) { stringNote.Set = 1; // Only displays 1 scale at a time. } } } return(neckStrings); }
private void lbxTunings_SelectedIndexChanged(object sender, EventArgs e) { if(Enum.IsDefined(typeof(Base.Tuning),lbxTunings.SelectedItem as string)) { _Tuning = (Base.Tuning)Enum.Parse(typeof(Base.Tuning), lbxTunings.SelectedItem as string, false); FillInStrings(); } }
public static List<string> GetTuning(Tuning pTuning) { switch (pTuning) { case Tuning.OpenD: { return OpenD; } case Tuning.OpenC: { return OpenC; } case Tuning.DroppedB: { return DroppedB; } default : { return StandardTuning; } } }
public Part(rhythmic beat, cyclic note, Tuning temperament) { this.temperament = temperament; }