Skip to content

Commit

Permalink
music-player
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamkaka committed Dec 28, 2023
1 parent 9313b97 commit 7996e9f
Show file tree
Hide file tree
Showing 79 changed files with 3,236 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Packages/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
!com.vrchat.core.*

# Change this to match your new package name
!com.xiaohan.assets
!com.xiaohan.assets
!com.varneon.vudon.music-player
8 changes: 8 additions & 0 deletions Packages/com.varneon.vudon.music-player/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "Varneon.VUdon.MusicPlayer.Editor",
"references": [
"Varneon.VUdon.MusicPlayer.Runtime",
"UdonSharp.Runtime",
"UdonSharp.Editor",
"Varneon.VUdon.Editors.Runtime",
"Varneon.VUdon.Editors.Editor",
"Varneon.VUdon.Logger.Runtime",
"VRC.Udon"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions Packages/com.varneon.vudon.music-player/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Varneon

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
7 changes: 7 additions & 0 deletions Packages/com.varneon.vudon.music-player/LICENSE.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Packages/com.varneon.vudon.music-player/Runtime.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using UnityEngine;

namespace Varneon.VUdon.MusicPlayer.Enums
{
public enum AndroidURLResolver
{
None,
[InspectorName("Jinnai (nextnex.com)")]
Jinnai,
Custom
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("Varneon.VUdon.MusicPlayer.Editor")]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions Packages/com.varneon.vudon.music-player/Runtime/ContentService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using UnityEngine;

namespace Varneon.VUdon.MusicPlayer.Enums
{
[Obsolete]
public enum ContentService
{
[InspectorName("YouTube")]
YouTube,
VRCDN,
Soundcloud,
Twitch,
Vimeo,
Mixcloud,
[InspectorName("NicoNico")]
NicoNico,
Youku,
GoogleDrive,
FacebookVideo,
Other
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: UILoadingIcon
m_Shader: {fileID: 4800000, guid: 9c0ee89d4b90d194cad35799c9b46121, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _ColorMask: 15
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UVSec: 0
- _UseUIAlphaClip: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions Packages/com.varneon.vudon.music-player/Runtime/MusicPlayerMode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using UnityEngine;

namespace Varneon.VUdon.MusicPlayer.Enums
{
public enum MusicPlayerMode
{
[Tooltip("Only one audio source is supported, recommended for 2D audio with audio filters, e.g. Reverb, Lowpass")]
[InspectorName("Unity (VRCUnityVideoPlayer)")]
Unity,

[Tooltip("Support for multiple speakers, suitable for making realistic speaker sources")]
[InspectorName("AVPro (VRCAVProVideoPlayer)")]
AVPro
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

namespace Varneon.VUdon.MusicPlayer
{
[CreateAssetMenu(menuName = "VUdon/Music Player/Song Playlist", fileName = "NewSongPlaylist.asset", order = 100)]
public class SongPlaylist : ScriptableObject
{
public SongPlaylistData Data
{
get
{
return FromJSON(rawJsonData);
}
set
{
rawJsonData = JsonConvert.SerializeObject(value, Formatting.Indented);
}
}

public static SongPlaylistData FromJSON(string json)
{
return string.IsNullOrWhiteSpace(json) ? new SongPlaylistData() : JsonConvert.DeserializeObject<SongPlaylistData>(json);
}

public static bool IsJSONValidSongPlaylistData(string json)
{
if (string.IsNullOrEmpty(json)) { return false; }

try
{
JObject root = JObject.Parse(json);

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

HashSet<string> propertyNames = new HashSet<string>(root.Properties().Select(p => p.Name));

if (typeof(SongPlaylistData).GetFields().Any(f => !propertyNames.Contains(f.Name))) { return false; }

return true;
}
catch
{
return false;
}
}

public string RawJsonData => rawJsonData;

[SerializeField]
internal string rawJsonData;

public class SongPlaylistData
{
/// <summary>
/// Name of the music library
/// </summary>
public string Name = string.Empty;

/// <summary>
/// Description of the music library
/// </summary>
public string Description = string.Empty;

/// <summary>
/// Is the song allowed to be played on streams and videos
/// </summary>
public bool CopyrightSafe = false;

/// <summary>
/// Can this playlist be automatically played
/// </summary>
public bool CanAutoplay = true;

/// <summary>
/// Playlists contained in this library
/// </summary>
public List<Song> Songs = new List<Song>();

public string Args = string.Empty;
}
}
}
Loading

0 comments on commit 7996e9f

Please sign in to comment.