-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
63 changed files
with
1,179 additions
and
1,698 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,42 @@ | ||
using System; | ||
using Microsoft.Win32; | ||
using NeteaseCloudMusicControl.Views.Methods; | ||
using Newtonsoft.Json.Linq; | ||
using System.Collections.Generic; | ||
using System.Configuration; | ||
using System.Data; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using System.Net; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
|
||
namespace NeteaseCloudMusicControl | ||
{ | ||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
private void Application_Startup(object sender, StartupEventArgs e) | ||
{ | ||
JObject keys = new(); | ||
keys.Add("ServerIpAddress", "127.0.0.1"); | ||
keys.Add("ServerPort", "4000"); | ||
keys.Add("CurrentVolume", "100"); | ||
IEnumerable<JProperty> properties = keys.Properties(); | ||
foreach (JProperty key in properties) | ||
{ | ||
if (Registry.GetValue(AppConfig.RegPath, key.Name, null) == null) | ||
{ | ||
Registry.SetValue(AppConfig.RegPath, key.Name, key.Value); | ||
} | ||
} | ||
CurrentResources.ServerIp = Registry.GetValue(AppConfig.RegPath, "ServerIpAddress", "127.0.0.1").ToString(); | ||
CurrentResources.ServerPort = Registry.GetValue(AppConfig.RegPath, "ServerPort", "4000").ToString(); | ||
CurrentResources.CurrentVolume = Registry.GetValue(AppConfig.RegPath, "CurrentVolume", "100").ToString(); | ||
CurrentResources.musicplayer = new(); | ||
CurrentResources.musicplayer.UnloadedBehavior = MediaState.Manual; | ||
CurrentResources.musicplayer.LoadedBehavior = MediaState.Manual; | ||
CurrentResources.musicplayer.MediaOpened += PlayerMethods.Musicplayer_MediaOpened; | ||
CurrentResources.musicplayer.MediaFailed += PlayerMethods.Musicplayer_MediaFailed; | ||
CurrentResources.musicplayer.MediaEnded += PlayerMethods.Musicplayer_MediaEnded; | ||
CurrentResources.musicplayer.Visibility = Visibility.Hidden; | ||
PlayerMethods.timer = new(); | ||
PlayerMethods.timer.Elapsed += PlayerMethods.Timer_Elapsed; | ||
} | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Controls; | ||
|
||
namespace NeteaseCloudMusicControl | ||
{ | ||
public static class CurrentResources | ||
{ | ||
public static MediaElement musicplayer; | ||
|
||
public static string soundPath; | ||
|
||
public static bool isPlayed = false; | ||
|
||
public static string CurrentVolume = string.Empty; | ||
|
||
public static string ServerIp = "127.0.0.1"; | ||
|
||
public static string ServerPort = "4000"; | ||
|
||
public static string Log = string.Empty; | ||
|
||
public static string SoundsPath = "./sounds.json"; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.