public void SendPhoto(SPhotoData photo) { if (_CheckRight(EUserRights.UploadPhotos)) { CVocaluxeServer.DoTask(CVocaluxeServer.SendPhoto, photo); } }
public void SendKeyStringEvent(string keyString, bool isShiftPressed = false, bool isAltPressed = false, bool isCtrlPressed = false) { if (!_CheckRight(EUserRights.UseKeyboard)) { return; } CVocaluxeServer.DoTask(CVocaluxeServer.SendKeyStringEvent, keyString, isShiftPressed, isAltPressed, isCtrlPressed); }
public Stream Index() { if (WebOperationContext.Current != null) { WebOperationContext.Current.OutgoingResponse.ContentType = "text/html"; } return(new MemoryStream(CVocaluxeServer.DoTask(CVocaluxeServer.GetSiteFile, "index.html"))); }
public void SendKeyEvent(string key) { if (!_CheckRight(EUserRights.UseKeyboard)) { return; } CVocaluxeServer.DoTask(CVocaluxeServer.SendKeyEvent, key); }
public Stream GetMp3File(int songId) { if (WebOperationContext.Current != null) { WebOperationContext.Current.OutgoingResponse.LastModified = DateTime.UtcNow; WebOperationContext.Current.OutgoingResponse.Headers.Add( HttpResponseHeader.Expires, DateTime.UtcNow.AddYears(1).ToString("r")); } String path = CVocaluxeServer.DoTask(CVocaluxeServer.GetMp3Path, songId); path = path.Replace("..", ""); if (!File.Exists(path) || !(path.EndsWith(".mp3", StringComparison.InvariantCulture) || path.EndsWith(".ogg", StringComparison.InvariantCulture) || path.EndsWith(".wav", StringComparison.InvariantCulture) || path.EndsWith(".webm", StringComparison.InvariantCulture))) { if (WebOperationContext.Current != null) { WebOperationContext.Current.OutgoingResponse.StatusCode = HttpStatusCode.NotFound; } return(null); } if (WebOperationContext.Current != null) { if (path.EndsWith(".mp3", StringComparison.InvariantCulture)) { WebOperationContext.Current.OutgoingResponse.ContentType = "audio/mpeg"; } else if (path.EndsWith(".ogg", StringComparison.InvariantCulture)) { WebOperationContext.Current.OutgoingResponse.ContentType = "audio/ogg"; } else if (path.EndsWith(".wav", StringComparison.InvariantCulture)) { WebOperationContext.Current.OutgoingResponse.ContentType = "audio/wav"; } else if (path.EndsWith(".webm", StringComparison.InvariantCulture)) { WebOperationContext.Current.OutgoingResponse.ContentType = "audio/webm"; } } return(File.OpenRead(path)); }
public SProfileData GetProfile(int profileId) { Guid sessionKey = _GetSession(); if (CSessionControl.GetUserIdFromSession(sessionKey) == profileId || _CheckRight(EUserRights.ViewOtherProfiles)) { bool isReadonly = (!CSessionControl.RequestRight(sessionKey, EUserRights.EditAllProfiles) && CSessionControl.GetUserIdFromSession(sessionKey) != profileId); return(CVocaluxeServer.DoTask(CVocaluxeServer.GetProfileData, profileId, isReadonly)); } return(new SProfileData()); }
public void SendProfile(SProfileData profile) { Guid sessionKey = _GetSession(); if (profile.ProfileId != -1) //-1 is the id for a new profile { if (CSessionControl.GetUserIdFromSession(sessionKey) != profile.ProfileId && !(_CheckRight(EUserRights.EditAllProfiles))) { return; } } CVocaluxeServer.DoTask(CVocaluxeServer.SendProfileData, profile); }
public SPlaylistSongInfo[] GetPlaylistSongs(int playlistId) { try { return(CVocaluxeServer.DoTask(CVocaluxeServer.GetPlaylistSongs, playlistId)); } catch (ArgumentException e) { if (WebOperationContext.Current != null) { WebOperationContext.Current.OutgoingResponse.StatusCode = HttpStatusCode.Forbidden; WebOperationContext.Current.OutgoingResponse.StatusDescription = e.Message; } return(new SPlaylistSongInfo[0]); } }
public bool PlaylistContainsSong(int songId, int playlistId) { try { return(CVocaluxeServer.DoTask(CVocaluxeServer.PlaylistContainsSong, songId, playlistId)); } catch (ArgumentException e) { if (WebOperationContext.Current != null) { WebOperationContext.Current.OutgoingResponse.StatusCode = HttpStatusCode.Forbidden; WebOperationContext.Current.OutgoingResponse.StatusDescription = e.Message; } return(false); } }
public int AddPlaylist(string playlistName) { if (!_CheckRight(EUserRights.CreatePlaylists)) { return(-1); } try { return(CVocaluxeServer.DoTask(CVocaluxeServer.AddPlaylist, playlistName)); } catch (ArgumentException e) { if (WebOperationContext.Current != null) { WebOperationContext.Current.OutgoingResponse.StatusCode = HttpStatusCode.Forbidden; WebOperationContext.Current.OutgoingResponse.StatusDescription = e.Message; } return(-1); } }
public Stream GetImgFile(string filename) { if (WebOperationContext.Current != null) { WebOperationContext.Current.OutgoingResponse.ContentType = "image/png"; WebOperationContext.Current.OutgoingResponse.LastModified = DateTime.UtcNow; WebOperationContext.Current.OutgoingResponse.Headers.Add( HttpResponseHeader.Expires, DateTime.UtcNow.AddYears(1).ToString("r")); } byte[] data = CVocaluxeServer.DoTask(CVocaluxeServer.GetSiteFile, "img/" + filename); if (data != null) { return(new MemoryStream(data)); } if (WebOperationContext.Current != null) { WebOperationContext.Current.OutgoingResponse.StatusCode = HttpStatusCode.NotFound; } return(null); }
public SSongInfo[] GetAllSongs() { return(CVocaluxeServer.DoTask(CVocaluxeServer.GetAllSongs)); }
public int GetUserRole(int profileId) { return(CVocaluxeServer.DoTask(CVocaluxeServer.GetUserRole, profileId)); }
public CBase64Image GetDelayedImage(string id) { return(CVocaluxeServer.DoTask(CVocaluxeServer.GetDelayedImage, id)); }
public SPlaylistData[] GetPlaylists() { return(CVocaluxeServer.DoTask(CVocaluxeServer.GetPlaylists)); }
public string GetServerVersion() { return(CVocaluxeServer.DoTask(CVocaluxeServer.GetServerVersion)); }
public SProfileData[] GetProfileList() { return(CVocaluxeServer.DoTask(CVocaluxeServer.GetProfileList)); }
public int GetCurrentSongId() { return(CVocaluxeServer.DoTask(CVocaluxeServer.GetCurrentSongId)); }
public SSongInfo GetSong(int songId) { return(CVocaluxeServer.DoTask(CVocaluxeServer.GetSong, songId)); }