// Use this for initialization void Start() { ServicePointManager.ServerCertificateValidationCallback = MyRemoteCertificateValidationCallback; ImplicitGrantAuth(); context = _spotify.GetPlayback(); Debug.Log("Device Id: " + context.Device.Id); shuffleState = context.ShuffleState; repeatState = context.RepeatState; privateProfile = _spotify.GetPrivateProfile(); Debug.Log(privateProfile.Country); audioVisualizer = GameObject.Find("AudioVisualizer"); audioVisualizerScript = audioVisualizer.GetComponent <AudioVisualizer>(); featuredPlaylistTabScript = FeaturedPlaylistTab.GetComponent <FeaturedPlaylistTabScript>(); searchResultsScript = searchResultsTab.GetComponent <SearchResultsScript>(); currentSongScript = CurrentSongGameObject.GetComponent <CurrentSong>(); recordPlayerScript = recordPlayer.GetComponent <RecordPlayer>(); //Ignore collisions between character controller and vinyls Physics.IgnoreLayerCollision(8, 9); OnClicked += SendAudioAnaylisToParticleVisualizer; }
async void OnPinClicked(object sender, PinClickedEventArgs e) { map.PropertyChanged -= OnMapChangeProperty; var pin = sender as PinWithEntity; pin.Label = ""; var d = Task.Delay(700); var recs = map.Pins.Where(p => pin.Position.Distance(p.Position) <= 90).Select(p => (p as PinWithEntity).Entity as Record).OrderBy(x => pin.Position.Distance(x.Point)); var len = recs.Count(); await d; var position = pin.Position; map.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(position.Latitude - 0.0015, position.Longitude), Distance.FromMeters(150))); State = MainPageStatus.ShowRecord; var playerView = new RecordPlayer(recs); relBox.HeightRequest = gridMenu.Height + (MapPage.Height - gridMenu.Height) / 2; relBox.Children.Add(playerView , Constraint.Constant(0), Constraint.Constant(0), Constraint.RelativeToParent((parent) => parent.Width), Constraint.RelativeToView(gridMenu, (parent, menu) => { return(parent.HeightRequest - menu.Height); }) ); map.PropertyChanged += OnMapChangeProperty; }
public JukeboxViewModel( SongsPaneViewModel songsPaneViewModel, AlbumsPaneViewModel albumsPaneViewModel, NowPlayingPaneViewModel nowPlayingPaneViewModel, UtilityPaneViewModel utilityPaneViewModel, ViewAlbumPaneViewModel viewAlbumPaneViewModel, ArtistsPaneViewModel artistsPaneViewModel, ViewArtistPaneViewModel viewArtistPaneViewModel, PlaylistPaneViewModel playlistPaneViewModel, IMessenger messenger, RecordPlayer player) { SongsPaneViewModel = songsPaneViewModel ?? throw new ArgumentNullException(nameof(songsPaneViewModel)); AlbumsPaneViewModel = albumsPaneViewModel ?? throw new ArgumentNullException(nameof(songsPaneViewModel)); ArtistsPaneViewModel = artistsPaneViewModel ?? throw new ArgumentNullException(nameof(artistsPaneViewModel)); NowPlayingPaneViewModel = nowPlayingPaneViewModel ?? throw new ArgumentNullException(nameof(nowPlayingPaneViewModel)); UtilityPaneViewModel = utilityPaneViewModel ?? throw new ArgumentNullException(nameof(utilityPaneViewModel)); ViewAlbumPaneViewModel = viewAlbumPaneViewModel ?? throw new ArgumentNullException(nameof(viewAlbumPaneViewModel)); ViewArtistPaneViewModel = viewArtistPaneViewModel ?? throw new ArgumentNullException(nameof(viewArtistPaneViewModel)); PlaylistPaneViewModel = playlistPaneViewModel ?? throw new ArgumentNullException(nameof(playlistPaneViewModel)); _messenger = messenger ?? throw new ArgumentNullException(nameof(messenger)); Player = player ?? throw new ArgumentNullException(nameof(player)); _messenger.RegisterMessageListener <List <SongViewModel> >(this, Messages.SendSongsToViewAlbum, ViewAlbumSongs); _messenger.RegisterMessageListener <List <ArtistViewModel> >(this, Messages.AllArtistsLoaded, LoadArtists); _messenger.RegisterMessageListener <List <AlbumViewModel> >(this, Messages.ViewArtistAlbums, ViewArtistAlbums); SongsButtonCommand = new RelayCommand(SongsButtonCommandMethod); AlbumsButtonCommand = new RelayCommand(AlbumsButtonCommandMethod); NowPlayingButtonCommand = new RelayCommand(NowPlayingButtonCommandMethod); ArtistsButtonCommand = new RelayCommand(ArtistsButtonCommandMethod); PlaylistButtonCommand = new RelayCommand(PlaylistButtonCommandMethod); }
private void OnTriggerEnter(Collider other) { if (!playing && other.gameObject.GetComponent <RecordPlayer>()) { RecordPlayer rp = other.gameObject.GetComponent <RecordPlayer>(); transform.position = rp.centerLocation.position; PlayDisk(); } }
// Use this for initialization void Start() { meshRenderer = GetComponent <MeshRenderer>(); spotifyManager = GameObject.Find("SpotifyManager"); script = spotifyManager.GetComponent <Spotify>(); recordPlayerScript = recordPlayer.GetComponent <RecordPlayer>(); audioVisualizer = GameObject.Find("AudioVisualizer"); particleVisualizerGameObject = GameObject.Find("Visualizer Room/ParticleVisualizer"); particleVisualizer = particleVisualizerGameObject.GetComponent <ParticleVisualizer>(); audioVisualizerScript = audioVisualizer.GetComponent <AudioVisualizer>(); raycast = GameObject.Find("/OVRPlayerController/OVRCameraRig/TrackingSpace/LocalAvatar/controller_right").GetComponent <Raycast>(); }
// Use this for initialization void Start() { meshRenderer = GetComponent <MeshRenderer>(); // a = meshRenderer.material.color.a; // c = meshRenderer.material.GetColor("_TintColor"); spotifyManager = GameObject.Find("SpotifyManager"); script = spotifyManager.GetComponent <Spotify>(); playlistNameText = playlistNameObject.GetComponent <UnityEngine.UI.Text>(); spriteRenderer = spriteGameObject.GetComponent <SpriteRenderer>(); recordPlayerScript = recordPlayer.GetComponent <RecordPlayer> (); }
void Start() { minAngle = 0; maxAngle = 56f; tonearm = transform.parent.gameObject; rp = transform.parent.parent.gameObject.GetComponent <RecordPlayer>(); crossRestingPos = transform.position; tonearmRestingPos = transform.parent.position; u = crossRestingPos - tonearmRestingPos; }
private void Awake() { rp = GetComponentInParent <RecordPlayer>(); }
public void LoadClipAndEmotion(RecordPlayer rp) { switch (experimentNo) { /*case 1: * recordClip = rp.clip_s[recordNo]; * emotionText = rp.text_s[recordNo].text; * break;*/// for silent, need to activate case 0: switch (caseNo) { case 0: recordClip = rp.clip_e0c0[recordNo]; emotionText = rp.text_e0c0[recordNo].text; break; case 1: recordClip = rp.clip_e0c1[recordNo]; emotionText = rp.text_e0c1[recordNo].text; break; case 2: recordClip = rp.clip_e0c2[recordNo]; emotionText = rp.text_e0c2[recordNo].text; break; case 3: recordClip = rp.clip_e0c3[recordNo]; emotionText = rp.text_e0c3[recordNo].text; break; case 4: recordClip = rp.clip_e0c4[recordNo]; emotionText = rp.text_e0c4[recordNo].text; break; case 5: recordClip = rp.clip_e0c5[recordNo]; emotionText = rp.text_e0c5[recordNo].text; break; case 6: recordClip = rp.clip_e0c6[recordNo]; emotionText = rp.text_e0c6[recordNo].text; break; case 7: recordClip = rp.clip_e0c7[recordNo]; emotionText = rp.text_e0c7[recordNo].text; break; case 8: recordClip = rp.clip_e0c8[recordNo]; emotionText = rp.text_e0c8[recordNo].text; break; case 9: recordClip = rp.clip_e0c9[recordNo]; emotionText = rp.text_e0c9[recordNo].text; break; } break; case 1: // originally 1, switched to 11 for silent switch (caseNo) { case 0: recordClip = rp.clip_e1c0[recordNo]; emotionText = rp.text_e1c0[recordNo].text; break; case 1: recordClip = rp.clip_e1c1[recordNo]; emotionText = rp.text_e1c1[recordNo].text; break; case 2: recordClip = rp.clip_e1c2[recordNo]; emotionText = rp.text_e1c2[recordNo].text; break; case 3: recordClip = rp.clip_e1c3[recordNo]; emotionText = rp.text_e1c3[recordNo].text; break; case 4: recordClip = rp.clip_e1c4[recordNo]; emotionText = rp.text_e1c4[recordNo].text; break; case 5: recordClip = rp.clip_e1c5[recordNo]; emotionText = rp.text_e1c5[recordNo].text; break; case 6: recordClip = rp.clip_e1c6[recordNo]; emotionText = rp.text_e1c6[recordNo].text; break; case 7: recordClip = rp.clip_e1c7[recordNo]; emotionText = rp.text_e1c7[recordNo].text; break; case 8: recordClip = rp.clip_e1c8[recordNo]; emotionText = rp.text_e1c8[recordNo].text; break; case 9: recordClip = rp.clip_e1c9[recordNo]; emotionText = rp.text_e1c9[recordNo].text; break; } break; case 2: switch (caseNo) { case 0: recordClip = rp.clip_e2c0[recordNo]; emotionText = rp.text_e2c0[recordNo].text; break; case 1: recordClip = rp.clip_e2c1[recordNo]; emotionText = rp.text_e2c1[recordNo].text; break; case 2: recordClip = rp.clip_e2c2[recordNo]; emotionText = rp.text_e2c2[recordNo].text; break; case 3: recordClip = rp.clip_e2c3[recordNo]; emotionText = rp.text_e2c3[recordNo].text; break; case 4: recordClip = rp.clip_e2c4[recordNo]; emotionText = rp.text_e2c4[recordNo].text; break; } break; case 3: switch (caseNo) { case 0: recordClip = rp.clip_e3c0[recordNo]; emotionText = rp.text_e3c0[recordNo].text; break; case 1: recordClip = rp.clip_e3c1[recordNo]; emotionText = rp.text_e3c1[recordNo].text; break; case 2: recordClip = rp.clip_e3c2[recordNo]; emotionText = rp.text_e3c2[recordNo].text; break; case 3: recordClip = rp.clip_e3c3[recordNo]; emotionText = rp.text_e3c3[recordNo].text; break; case 4: recordClip = rp.clip_e3c4[recordNo]; emotionText = rp.text_e3c4[recordNo].text; break; case 5: recordClip = rp.clip_e3c5[recordNo]; emotionText = rp.text_e3c5[recordNo].text; break; case 6: recordClip = rp.clip_e3c6[recordNo]; emotionText = rp.text_e3c6[recordNo].text; break; case 7: recordClip = rp.clip_e3c7[recordNo]; emotionText = rp.text_e3c7[recordNo].text; break; case 8: recordClip = rp.clip_e3c8[recordNo]; emotionText = rp.text_e3c8[recordNo].text; break; case 9: recordClip = rp.clip_e3c9[recordNo]; emotionText = rp.text_e3c9[recordNo].text; break; } break; case 4: switch (caseNo) { case 0: recordClip = rp.clip_e4c0[recordNo]; emotionText = rp.text_e4c0[recordNo].text; break; case 1: recordClip = rp.clip_e4c1[recordNo]; emotionText = rp.text_e4c1[recordNo].text; break; case 2: recordClip = rp.clip_e4c2[recordNo]; emotionText = rp.text_e4c2[recordNo].text; break; case 3: recordClip = rp.clip_e4c3[recordNo]; emotionText = rp.text_e4c3[recordNo].text; break; case 4: recordClip = rp.clip_e4c4[recordNo]; emotionText = rp.text_e4c4[recordNo].text; break; case 5: recordClip = rp.clip_e4c5[recordNo]; emotionText = rp.text_e4c5[recordNo].text; break; case 6: recordClip = rp.clip_e4c6[recordNo]; emotionText = rp.text_e4c6[recordNo].text; break; case 7: recordClip = rp.clip_e4c7[recordNo]; emotionText = rp.text_e4c7[recordNo].text; break; case 8: recordClip = rp.clip_e4c8[recordNo]; emotionText = rp.text_e4c8[recordNo].text; break; case 9: recordClip = rp.clip_e4c9[recordNo]; emotionText = rp.text_e4c9[recordNo].text; break; } break; } // load emotion if (emotionText != null) { string[] words = emotionText.Split(' '); recordEmotion = new OneEmotion(float.Parse(words[0]), float.Parse(words[1]), float.Parse(words[2]), float.Parse(words[3]), float.Parse(words[4]), float.Parse(words[5])); } }
// Use this for initialization void Start() { script = SpotifyManager.GetComponent <Spotify>(); recordPlayerScript = recordPlayer.GetComponent <RecordPlayer> (); }