├── DjmaxRandomSelectorV ├── Version.txt ├── Data │ ├── CurrentPlaylist.json │ ├── Config.json │ ├── CurrentFilter.json │ ├── Preset │ │ ├── Default.json │ │ └── Ladder Match Season 8 │ │ │ ├── Grand Master.json │ │ │ ├── Iron I.json │ │ │ ├── Iron II.json │ │ │ ├── Iron III.json │ │ │ ├── Iron IV.json │ │ │ ├── Bronze II~I.json │ │ │ ├── Bronze IV~III.json │ │ │ ├── Silver IV~II.json │ │ │ ├── Gold I.json │ │ │ ├── Gold IV.json │ │ │ ├── Master.json │ │ │ ├── Silver I.json │ │ │ ├── Diamond I.json │ │ │ ├── Gold III~II.json │ │ │ ├── Platinum I.json │ │ │ ├── Platinum II.json │ │ │ ├── Platinum III.json │ │ │ ├── Platinum IV.json │ │ │ └── Diamond IV~II.json │ └── Playlist │ │ ├── Boss Songs.json │ │ └── Popular Songs.json ├── DMRSV3_Data │ ├── CurrentPlaylist.json │ ├── Config.json │ ├── CurrentFilter.json │ └── appdata.json ├── Version3.txt ├── icon.ico ├── Images │ ├── 4B_OFF.png │ ├── 4B_ON.png │ ├── 5B_OFF.png │ ├── 5B_ON.png │ ├── 6B_OFF.png │ ├── 6B_ON.png │ ├── 8B_OFF.png │ ├── 8B_ON.png │ ├── Close.png │ ├── Info.png │ ├── d_blk.png │ ├── d_org.png │ ├── d_red.png │ ├── d_scb.png │ ├── d_sck.png │ ├── d_scp.png │ ├── d_scr.png │ ├── d_ylw.png │ ├── except.png │ ├── icon.png │ ├── icon2.png │ ├── Minimize.png │ ├── btn_left.png │ ├── mode_fs.png │ ├── mode_on.png │ ├── setting.png │ ├── addon_none.png │ ├── aider_auto.png │ ├── btn_right.png │ ├── inventory.png │ ├── aider_observe.png │ ├── level_master.png │ ├── level_beginner.png │ ├── level_standard.png │ ├── aider_auto_locked.png │ ├── level_beginner_locked.png │ └── level_master_locked.png ├── Fonts │ ├── Lato-Bold.ttf │ ├── Lato-Thin.ttf │ ├── Lato-Black.ttf │ ├── Lato-Light.ttf │ ├── Lato-Regular.ttf │ └── BebasNeue-Regular.ttf ├── Models │ ├── Category.cs │ ├── LinkDiscItem.cs │ ├── Playlist.cs │ ├── PliCategory.cs │ ├── FavoriteItem.cs │ ├── HistoryItem.cs │ ├── LevelIndicator.cs │ ├── PlaylistItem.cs │ ├── VArchivePatternItem.cs │ └── ListUpdater.cs ├── Messages │ ├── FilterMessage.cs │ ├── PatternMessage.cs │ ├── FavoriteMessage.cs │ ├── VArchiveMessage.cs │ ├── FilterOptionMessage.cs │ └── SettingMessage.cs ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Views │ ├── InfoView.xaml.cs │ ├── SettingView.xaml.cs │ ├── MainView.xaml.cs │ ├── HistoryView.xaml.cs │ ├── ShellView.xaml.cs │ ├── VArchiveWizardView.xaml.cs │ ├── FavoriteView.xaml.cs │ ├── BasicFilterView.xaml.cs │ ├── FilterOptionView.xaml.cs │ ├── AdvancedFilterView.xaml.cs │ ├── FilterOptionIndicatorView.xaml.cs │ ├── FilterOptionIndicatorView.xaml │ ├── MainView.xaml │ ├── InfoView.xaml │ ├── HistoryView.xaml │ └── FilterOptionView.xaml ├── VersionContainer.cs ├── App.xaml.cs ├── Dmrsv3AppData.cs ├── Resources │ └── FontDictionary.xaml ├── CategoryContainer.cs ├── App.xaml ├── WindowTitleHelper.cs ├── DjmaxRandomSelectorV.sln ├── App.config ├── Dmrsv3Configuration.cs ├── FileManager.cs ├── ViewModels │ ├── InfoViewModel.cs │ ├── MainViewModel.cs │ ├── HistoryViewModel.cs │ ├── ShellViewModel.cs │ ├── FilterOptionViewModel.cs │ ├── SettingViewModel.cs │ ├── FilterOptionIndicatorViewModel.cs │ ├── VArchiveWizardViewModel.cs │ └── FavoriteViewModel.cs ├── ExecutionHelper.cs ├── UpdateManager.cs ├── TrackDB.cs ├── RandomSelector.cs ├── Bootstrapper.cs └── DjmaxRandomSelectorV.csproj ├── Dmrsv.RandomSelector ├── Enums │ ├── FilterType.cs │ ├── MusicForm.cs │ ├── LevelPreference.cs │ ├── InputMethod.cs │ ├── Difficulty.cs │ └── ButtonTunes.cs ├── ISelector.cs ├── IFilter.cs ├── Dmrsv.RandomSelector.csproj ├── IHistory.cs ├── LocationInfo.cs ├── MusicInfo.cs ├── FilterBase.cs ├── Track.cs ├── SelectorBase.cs ├── Pattern.cs ├── AdvancedFilter.cs ├── SelectorWithHistory.cs ├── PatternPicker.cs ├── History.cs ├── TitleComparer.cs └── BasicFilter.cs ├── README.md ├── DjmaxRandomSelectorV.sln ├── .gitattributes └── .gitignore /DjmaxRandomSelectorV/Version.txt: -------------------------------------------------------------------------------- 1 | 3.0.0,250329 -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/CurrentPlaylist.json: -------------------------------------------------------------------------------- 1 | { 2 | "Playlist": [] 3 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/DMRSV3_Data/CurrentPlaylist.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [] 3 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Version3.txt: -------------------------------------------------------------------------------- 1 | 3.1.0 2 | 250911 3 | titleTest 4 | descriptionTest -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/icon.ico -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/4B_OFF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/4B_OFF.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/4B_ON.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/4B_ON.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/5B_OFF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/5B_OFF.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/5B_ON.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/5B_ON.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/6B_OFF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/6B_OFF.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/6B_ON.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/6B_ON.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/8B_OFF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/8B_OFF.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/8B_ON.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/8B_ON.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/Close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/Close.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/Info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/Info.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/d_blk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/d_blk.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/d_org.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/d_org.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/d_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/d_red.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/d_scb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/d_scb.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/d_sck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/d_sck.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/d_scp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/d_scp.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/d_scr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/d_scr.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/d_ylw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/d_ylw.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/except.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/except.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/icon.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/icon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/icon2.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Fonts/Lato-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Fonts/Lato-Bold.ttf -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Fonts/Lato-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Fonts/Lato-Thin.ttf -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/Minimize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/Minimize.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/btn_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/btn_left.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/mode_fs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/mode_fs.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/mode_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/mode_on.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/setting.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Fonts/Lato-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Fonts/Lato-Black.ttf -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Fonts/Lato-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Fonts/Lato-Light.ttf -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Fonts/Lato-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Fonts/Lato-Regular.ttf -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/addon_none.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/addon_none.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/aider_auto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/aider_auto.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/btn_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/btn_right.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/inventory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/inventory.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/aider_observe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/aider_observe.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/level_master.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/level_master.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Fonts/BebasNeue-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Fonts/BebasNeue-Regular.ttf -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/level_beginner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/level_beginner.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/level_standard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/level_standard.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/aider_auto_locked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/aider_auto_locked.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/level_beginner_locked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/level_beginner_locked.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Images/level_master_locked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/HEAD/DjmaxRandomSelectorV/Images/level_master_locked.png -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Models/Category.cs: -------------------------------------------------------------------------------- 1 | namespace DjmaxRandomSelectorV.Models 2 | { 3 | public record Category(string Name, string Id, string SteamId, int Type); 4 | } 5 | -------------------------------------------------------------------------------- /Dmrsv.RandomSelector/Enums/FilterType.cs: -------------------------------------------------------------------------------- 1 | namespace Dmrsv.RandomSelector 2 | { 3 | public enum FilterType 4 | { 5 | Query, 6 | Playlist 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Dmrsv.RandomSelector/Enums/MusicForm.cs: -------------------------------------------------------------------------------- 1 | namespace Dmrsv.RandomSelector 2 | { 3 | public enum MusicForm 4 | { 5 | Default, 6 | Free 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Messages/FilterMessage.cs: -------------------------------------------------------------------------------- 1 | using Dmrsv.RandomSelector; 2 | 3 | namespace DjmaxRandomSelectorV.Messages 4 | { 5 | public record FilterMessage(IFilter Item); 6 | } 7 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Messages/PatternMessage.cs: -------------------------------------------------------------------------------- 1 | using Dmrsv.RandomSelector; 2 | 3 | namespace DjmaxRandomSelectorV.Messages 4 | { 5 | public record PatternMessage(Pattern Item); 6 | } 7 | -------------------------------------------------------------------------------- /Dmrsv.RandomSelector/ISelector.cs: -------------------------------------------------------------------------------- 1 | namespace Dmrsv.RandomSelector 2 | { 3 | public interface ISelector 4 | { 5 | Pattern? Select(IList patternList); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Dmrsv.RandomSelector/Enums/LevelPreference.cs: -------------------------------------------------------------------------------- 1 | namespace Dmrsv.RandomSelector 2 | { 3 | public enum LevelPreference 4 | { 5 | None, 6 | Lowest, 7 | Highest 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Dmrsv.RandomSelector/Enums/InputMethod.cs: -------------------------------------------------------------------------------- 1 | namespace Dmrsv.RandomSelector 2 | { 3 | public enum InputMethod 4 | { 5 | Default, 6 | WithAutoStart, 7 | NotInput 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Messages/FavoriteMessage.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace DjmaxRandomSelectorV.Messages 4 | { 5 | public record FavoriteMessage(List Favorite, List Blacklist); 6 | } 7 | -------------------------------------------------------------------------------- /Dmrsv.RandomSelector/IFilter.cs: -------------------------------------------------------------------------------- 1 | namespace Dmrsv.RandomSelector 2 | { 3 | public interface IFilter 4 | { 5 | bool IsUpdated { get; } 6 | IEnumerable Filter(IEnumerable trackList); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Messages/VArchiveMessage.cs: -------------------------------------------------------------------------------- 1 | using Dmrsv.RandomSelector; 2 | using System.Collections.Generic; 3 | 4 | namespace DjmaxRandomSelectorV.Messages 5 | { 6 | public record VArchiveMessage(int[] Items, string Command); 7 | } 8 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Models/LinkDiscItem.cs: -------------------------------------------------------------------------------- 1 | namespace DjmaxRandomSelectorV.Models 2 | { 3 | public class LinkDiscItem 4 | { 5 | public int Id { get; set; } 6 | public string[][] RequiredDlc { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Messages/FilterOptionMessage.cs: -------------------------------------------------------------------------------- 1 | using Dmrsv.RandomSelector; 2 | 3 | namespace DjmaxRandomSelectorV.Messages 4 | { 5 | public record FilterOptionMessage(int RecentsCount, MusicForm MusicForm, InputMethod InputMethod, LevelPreference LevelPreference); 6 | } 7 | -------------------------------------------------------------------------------- /Dmrsv.RandomSelector/Dmrsv.RandomSelector.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0-windows 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/Config.json: -------------------------------------------------------------------------------- 1 | { 2 | "RecentsCount": 5, 3 | "Mode": 0, 4 | "Aider": 0, 5 | "Level": 0, 6 | "FilterType": 0, 7 | "InputDelay": 30, 8 | "SavesRecents": false, 9 | "OwnedDlcs": [], 10 | "Position": [], 11 | "Exclusions": [], 12 | "Favorite": [], 13 | "Blacklist": [], 14 | "AllTrackVersion": 241219 15 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Models/Playlist.cs: -------------------------------------------------------------------------------- 1 | namespace DjmaxRandomSelectorV.Models 2 | { 3 | // 3.0.0 or later 4 | public class Playlist 5 | { 6 | public int[] Items { get; set; } 7 | } 8 | 9 | // 2.2.0 or earlier 10 | public class OldPlaylist 11 | { 12 | public PlaylistItem[] Playlist { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Dmrsv.RandomSelector/IHistory.cs: -------------------------------------------------------------------------------- 1 | namespace Dmrsv.RandomSelector 2 | { 3 | public interface IHistory 4 | { 5 | int Capacity { get; set; } 6 | int Count { get; } 7 | void Enqueue(T item); 8 | T Dequeue(); 9 | bool Contains(T item); 10 | void Clear(); 11 | IEnumerable GetItems(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Dmrsv.RandomSelector/LocationInfo.cs: -------------------------------------------------------------------------------- 1 | namespace Dmrsv.RandomSelector 2 | { 3 | public record LocationInfo 4 | { 5 | public int TrackId { get; init; } = -1; 6 | public char Group { get; init; } = '#'; 7 | public int Index { get; init; } = 0; 8 | public Dictionary DifficultyOrder { get; init; } = new(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Dmrsv.RandomSelector/MusicInfo.cs: -------------------------------------------------------------------------------- 1 | namespace Dmrsv.RandomSelector 2 | { 3 | public record MusicInfo 4 | { 5 | public int Id { get; init; } = -1; 6 | public string Title { get; init; } = string.Empty; 7 | public string Composer { get; init; } = string.Empty; 8 | public string Category { get; init; } = string.Empty; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Views/InfoView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace DjmaxRandomSelectorV.Views 4 | { 5 | /// 6 | /// InfoView.xaml에 대한 상호 작용 논리 7 | /// 8 | public partial class InfoView : Window 9 | { 10 | public InfoView() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Views/SettingView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace DjmaxRandomSelectorV.Views 4 | { 5 | /// 6 | /// SettingView.xaml에 대한 상호 작용 논리 7 | /// 8 | public partial class SettingView : Window 9 | { 10 | public SettingView() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/VersionContainer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DjmaxRandomSelectorV 4 | { 5 | public class VersionContainer 6 | { 7 | public Version CurrentAppVersion { get; set; } 8 | public Version LatestAppVersion { get; set; } 9 | public long AllTrackVersion { get; set; } 10 | public string AppdataVersion { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Views/MainView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace DjmaxRandomSelectorV.Views 4 | { 5 | /// 6 | /// MainView.xaml에 대한 상호 작용 논리 7 | /// 8 | public partial class MainView : UserControl 9 | { 10 | public MainView() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Views/HistoryView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace DjmaxRandomSelectorV.Views 4 | { 5 | /// 6 | /// HistoryView.xaml에 대한 상호 작용 논리 7 | /// 8 | public partial class HistoryView : UserControl 9 | { 10 | public HistoryView() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Models/PliCategory.cs: -------------------------------------------------------------------------------- 1 | namespace DjmaxRandomSelectorV.Models 2 | { 3 | public class PliCategory 4 | { 5 | public string Major { get; set; } 6 | public PliCategoryMinor[] Minors { get; set; } 7 | } 8 | 9 | public class PliCategoryMinor 10 | { 11 | public string Name { get; set; } 12 | public int[][] Items { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace DjmaxRandomSelectorV 10 | { 11 | /// 12 | /// App.xaml에 대한 상호 작용 논리 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Messages/SettingMessage.cs: -------------------------------------------------------------------------------- 1 | using Dmrsv.RandomSelector; 2 | using System.Collections.Generic; 3 | 4 | namespace DjmaxRandomSelectorV.Messages 5 | { 6 | public class SettingMessage 7 | { 8 | public FilterType FilterType { get; set; } 9 | public int InputInterval { get; set; } 10 | public bool SavesExclusion { get; set; } 11 | public List OwnedDlcs { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/DMRSV3_Data/Config.json: -------------------------------------------------------------------------------- 1 | { 2 | "filterType": 0, 3 | "inputDelay": 30, 4 | "favorite": [], 5 | "blacklist": [], 6 | "ownedDlcs": [], 7 | "savesRecents": false, 8 | "recentPlayed": [], 9 | "startKeyCode": 118, 10 | "recentsCount": 5, 11 | "mode": 0, 12 | "aider": 0, 13 | "level": 0, 14 | "position": [], 15 | "size": [], 16 | "allTrackVersion": 0, 17 | "appdataVersion": "0" 18 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/CurrentFilter.json: -------------------------------------------------------------------------------- 1 | { 2 | "ButtonTunes": [ 3 | "4B", 4 | "5B", 5 | "6B", 6 | "8B" 7 | ], 8 | "Difficulties": [ 9 | "NM", 10 | "HD", 11 | "MX", 12 | "SC" 13 | ], 14 | "Categories": [ 15 | "RP", 16 | "P1", 17 | "P2", 18 | "GG" 19 | ], 20 | "Levels": [ 21 | 1, 22 | 15 23 | ], 24 | "ScLevels": [ 25 | 1, 26 | 15 27 | ], 28 | "IncludesFavorite": false 29 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/Preset/Default.json: -------------------------------------------------------------------------------- 1 | { 2 | "ButtonTunes": [ 3 | "4B", 4 | "5B", 5 | "6B", 6 | "8B" 7 | ], 8 | "Difficulties": [ 9 | "NM", 10 | "HD", 11 | "MX", 12 | "SC" 13 | ], 14 | "Categories": [ 15 | "RP", 16 | "P1", 17 | "P2", 18 | "GG" 19 | ], 20 | "Levels": [ 21 | 1, 22 | 15 23 | ], 24 | "ScLevels": [ 25 | 1, 26 | 15 27 | ], 28 | "IncludesFavorite": false 29 | } -------------------------------------------------------------------------------- /Dmrsv.RandomSelector/FilterBase.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace Dmrsv.RandomSelector 4 | { 5 | public abstract class FilterBase : IFilter 6 | { 7 | [JsonIgnore] 8 | public bool IsUpdated { get; protected set; } 9 | 10 | public FilterBase() 11 | { 12 | IsUpdated = true; 13 | } 14 | 15 | public abstract IEnumerable Filter(IEnumerable trackList); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Dmrsv.RandomSelector/Track.cs: -------------------------------------------------------------------------------- 1 | namespace Dmrsv.RandomSelector 2 | { 3 | public record Track 4 | { 5 | public MusicInfo Info { get; init; } = new(); 6 | public Pattern[] Patterns { get; init; } = Array.Empty(); 7 | public bool IsPlayable { get; init; } = false; 8 | 9 | public int Id => Info.Id; 10 | public string Title => Info.Title; 11 | public string Composer => Info.Composer; 12 | public string Category => Info.Category; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Models/FavoriteItem.cs: -------------------------------------------------------------------------------- 1 | using Dmrsv.RandomSelector; 2 | 3 | namespace DjmaxRandomSelectorV.Models 4 | { 5 | public class FavoriteItem 6 | { 7 | public MusicInfo Info { get; set; } 8 | public string Category { get; set; } 9 | public bool IsPlayable { get; set; } 10 | public int Status { get; set; } 11 | 12 | public int Id => Info.Id; 13 | public string Title => Info.Title; 14 | public string Composer => Info.Composer; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Dmrsv3AppData.cs: -------------------------------------------------------------------------------- 1 | using DjmaxRandomSelectorV.Models; 2 | 3 | namespace DjmaxRandomSelectorV 4 | { 5 | public class Dmrsv3AppData 6 | { 7 | public string[] CategoryType { get; set; } 8 | public string[] BasicCategories { get; set; } 9 | public Category[] Categories { get; set; } 10 | public PliCategory[] PliCategories { get; set; } 11 | public LinkDiscItem[] LinkDisc { get; set; } 12 | // TODO: title converter for multi-language support 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Dmrsv.RandomSelector/SelectorBase.cs: -------------------------------------------------------------------------------- 1 | namespace Dmrsv.RandomSelector 2 | { 3 | public abstract class SelectorBase : ISelector 4 | { 5 | public virtual Pattern? Select(IList patternList) 6 | { 7 | if (!patternList.Any() || patternList == null) 8 | { 9 | return null; 10 | } 11 | 12 | var random = new Random(); 13 | int index = random.Next(patternList.Count); 14 | return patternList[index]; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/DMRSV3_Data/CurrentFilter.json: -------------------------------------------------------------------------------- 1 | { 2 | "buttonTunes": [ 3 | "4B", 4 | "5B", 5 | "6B", 6 | "8B" 7 | ], 8 | "difficulties": [ 9 | "NM", 10 | "HD", 11 | "MX", 12 | "SC" 13 | ], 14 | "categories": [ 15 | "R", 16 | "RV", 17 | "P1", 18 | "P2", 19 | "GG" 20 | ], 21 | "levels": [ 22 | 1, 23 | 15 24 | ], 25 | "scLevels": [ 26 | 1, 27 | 15 28 | ], 29 | "includesFavorite": false 30 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Models/HistoryItem.cs: -------------------------------------------------------------------------------- 1 | using Dmrsv.RandomSelector; 2 | 3 | namespace DjmaxRandomSelectorV.Models 4 | { 5 | public class HistoryItem 6 | { 7 | public int Number { get; set; } 8 | public MusicInfo Info { get; set; } 9 | public string Category { get; set; } 10 | public string Style { get; set; } 11 | public string Level { get; set; } 12 | public string Time { get; set; } 13 | 14 | public string ButtonTunes => Style[..2]; 15 | public string Difficulty => Style[2..4]; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Resources/FontDictionary.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | pack://application:,,,/Fonts/#Lato Light 5 | pack://application:,,,/Fonts/#Lato 6 | pack://application:,,,/Fonts/#Lato Black 7 | pack://application:,,,/Fonts/#Bebas Neue 8 | 9 | -------------------------------------------------------------------------------- /Dmrsv.RandomSelector/Pattern.cs: -------------------------------------------------------------------------------- 1 | using Dmrsv.RandomSelector.Enums; 2 | 3 | namespace Dmrsv.RandomSelector 4 | { 5 | public record Pattern 6 | { 7 | public MusicInfo Info { get; init; } = new(); 8 | public ButtonTunes Button { get; init; } = default; 9 | public Difficulty Difficulty { get; init; } = default; 10 | public int Level { get; init; } = default; 11 | 12 | public int TrackId => Info.Id; 13 | public int PatternId => TrackId * 100 + (int)Button * 10 + (int)Difficulty; 14 | public string Style => Button.AsString() + Difficulty.AsString(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Models/LevelIndicator.cs: -------------------------------------------------------------------------------- 1 | using Caliburn.Micro; 2 | using System.Collections.Generic; 3 | 4 | namespace DjmaxRandomSelectorV.Models 5 | { 6 | public class LevelIndicator : PropertyChangedBase 7 | { 8 | private readonly int _number; 9 | private readonly IList _source; 10 | 11 | public int Number { get => _number; } 12 | public bool Value 13 | { 14 | get => _source[0] <= _number && _number <= _source[1]; 15 | } 16 | public LevelIndicator(int number, IList source) 17 | { 18 | _number = number; 19 | _source = source; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Models/PlaylistItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Dmrsv.RandomSelector; 7 | 8 | namespace DjmaxRandomSelectorV.Models 9 | { 10 | public record PlaylistItem 11 | { 12 | public int PatternId { get; init; } 13 | public string Title { get; init; } 14 | public string Composer { get; init; } 15 | public string Category { get; init; } 16 | public string Style { get; init; } 17 | public string ButtonTunes => Style[..2]; 18 | public string Difficulty => Style[2..]; 19 | public string Level { get; init; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/Preset/Ladder Match Season 8/Grand Master.json: -------------------------------------------------------------------------------- 1 | { 2 | "ButtonTunes": [ 3 | "4B", 4 | "5B", 5 | "6B", 6 | "8B" 7 | ], 8 | "Difficulties": [ 9 | "SC" 10 | ], 11 | "Categories": [ 12 | "RP", 13 | "P1", 14 | "P2", 15 | "P3", 16 | "TR", 17 | "CE", 18 | "BS", 19 | "VE", 20 | "VE2", 21 | "VE3", 22 | "ES", 23 | "T1", 24 | "T2", 25 | "T3", 26 | "TQ", 27 | "GG", 28 | "CHU", 29 | "CY", 30 | "DM", 31 | "ESTI", 32 | "GC", 33 | "GF", 34 | "MD", 35 | "NXN" 36 | ], 37 | "Levels": [ 38 | 15, 39 | 15 40 | ], 41 | "ScLevels": [ 42 | 12, 43 | 15 44 | ], 45 | "IncludesFavorite": false 46 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DJMAX Random Selector V 2 | 3 | ## Introduction 4 | 5 | A program for selecting music randomly in DJMAX RESPECT V. Set the filter you want and play instantly without thinking about what music to choose. 6 | 7 | ## Installation 8 | 9 | - Download lastest release at [Releases](https://github.com/wowvv0w/djmax-random-selector-v/releases) page. 10 | - Extract the files. 11 | - Run DJMAX Random Selector V.exe 12 | - Click the setting button at the bottom right. 13 | - In Track List Setting, Select your own DLCs and click APPLY. 14 | - Set the filter you would like to. 15 | - In Freestyle Mode of DJMAX, set following things: 'All Track' category, 'Sort by Title (A to Z)', 'Korean' language. 16 | - All done. Now press F7 and enjoy. 17 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Views/ShellView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Shapes; 14 | 15 | namespace DjmaxRandomSelectorV.Views 16 | { 17 | /// 18 | /// ShellView.xaml에 대한 상호 작용 논리 19 | /// 20 | public partial class ShellView : Window 21 | { 22 | public ShellView() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/Preset/Ladder Match Season 8/Iron I.json: -------------------------------------------------------------------------------- 1 | { 2 | "ButtonTunes": [ 3 | "4B", 4 | "5B", 5 | "6B", 6 | "8B" 7 | ], 8 | "Difficulties": [ 9 | "NM", 10 | "HD", 11 | "MX" 12 | ], 13 | "Categories": [ 14 | "RP", 15 | "P1", 16 | "P2", 17 | "P3", 18 | "TR", 19 | "CE", 20 | "BS", 21 | "VE", 22 | "VE2", 23 | "VE3", 24 | "ES", 25 | "T1", 26 | "T2", 27 | "T3", 28 | "TQ", 29 | "GG", 30 | "CHU", 31 | "CY", 32 | "DM", 33 | "ESTI", 34 | "GC", 35 | "GF", 36 | "MD", 37 | "NXN" 38 | ], 39 | "Levels": [ 40 | 5, 41 | 9 42 | ], 43 | "ScLevels": [ 44 | 1, 45 | 1 46 | ], 47 | "IncludesFavorite": false 48 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/Preset/Ladder Match Season 8/Iron II.json: -------------------------------------------------------------------------------- 1 | { 2 | "ButtonTunes": [ 3 | "4B", 4 | "5B", 5 | "6B", 6 | "8B" 7 | ], 8 | "Difficulties": [ 9 | "NM", 10 | "HD", 11 | "MX" 12 | ], 13 | "Categories": [ 14 | "RP", 15 | "P1", 16 | "P2", 17 | "P3", 18 | "TR", 19 | "CE", 20 | "BS", 21 | "VE", 22 | "VE2", 23 | "VE3", 24 | "ES", 25 | "T1", 26 | "T2", 27 | "T3", 28 | "TQ", 29 | "GG", 30 | "CHU", 31 | "CY", 32 | "DM", 33 | "ESTI", 34 | "GC", 35 | "GF", 36 | "MD", 37 | "NXN" 38 | ], 39 | "Levels": [ 40 | 4, 41 | 8 42 | ], 43 | "ScLevels": [ 44 | 1, 45 | 1 46 | ], 47 | "IncludesFavorite": false 48 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/Preset/Ladder Match Season 8/Iron III.json: -------------------------------------------------------------------------------- 1 | { 2 | "ButtonTunes": [ 3 | "4B", 4 | "5B", 5 | "6B", 6 | "8B" 7 | ], 8 | "Difficulties": [ 9 | "NM", 10 | "HD", 11 | "MX" 12 | ], 13 | "Categories": [ 14 | "RP", 15 | "P1", 16 | "P2", 17 | "P3", 18 | "TR", 19 | "CE", 20 | "BS", 21 | "VE", 22 | "VE2", 23 | "VE3", 24 | "ES", 25 | "T1", 26 | "T2", 27 | "T3", 28 | "TQ", 29 | "GG", 30 | "CHU", 31 | "CY", 32 | "DM", 33 | "ESTI", 34 | "GC", 35 | "GF", 36 | "MD", 37 | "NXN" 38 | ], 39 | "Levels": [ 40 | 4, 41 | 7 42 | ], 43 | "ScLevels": [ 44 | 1, 45 | 1 46 | ], 47 | "IncludesFavorite": false 48 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/Preset/Ladder Match Season 8/Iron IV.json: -------------------------------------------------------------------------------- 1 | { 2 | "ButtonTunes": [ 3 | "4B", 4 | "5B", 5 | "6B", 6 | "8B" 7 | ], 8 | "Difficulties": [ 9 | "NM", 10 | "HD", 11 | "MX" 12 | ], 13 | "Categories": [ 14 | "RP", 15 | "P1", 16 | "P2", 17 | "P3", 18 | "TR", 19 | "CE", 20 | "BS", 21 | "VE", 22 | "VE2", 23 | "VE3", 24 | "ES", 25 | "T1", 26 | "T2", 27 | "T3", 28 | "TQ", 29 | "GG", 30 | "CHU", 31 | "CY", 32 | "DM", 33 | "ESTI", 34 | "GC", 35 | "GF", 36 | "MD", 37 | "NXN" 38 | ], 39 | "Levels": [ 40 | 1, 41 | 6 42 | ], 43 | "ScLevels": [ 44 | 1, 45 | 1 46 | ], 47 | "IncludesFavorite": false 48 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/Preset/Ladder Match Season 8/Bronze II~I.json: -------------------------------------------------------------------------------- 1 | { 2 | "ButtonTunes": [ 3 | "4B", 4 | "5B", 5 | "6B", 6 | "8B" 7 | ], 8 | "Difficulties": [ 9 | "NM", 10 | "HD", 11 | "MX" 12 | ], 13 | "Categories": [ 14 | "RP", 15 | "P1", 16 | "P2", 17 | "P3", 18 | "TR", 19 | "CE", 20 | "BS", 21 | "VE", 22 | "VE2", 23 | "VE3", 24 | "ES", 25 | "T1", 26 | "T2", 27 | "T3", 28 | "TQ", 29 | "GG", 30 | "CHU", 31 | "CY", 32 | "DM", 33 | "ESTI", 34 | "GC", 35 | "GF", 36 | "MD", 37 | "NXN" 38 | ], 39 | "Levels": [ 40 | 6, 41 | 11 42 | ], 43 | "ScLevels": [ 44 | 1, 45 | 1 46 | ], 47 | "IncludesFavorite": false 48 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/Preset/Ladder Match Season 8/Bronze IV~III.json: -------------------------------------------------------------------------------- 1 | { 2 | "ButtonTunes": [ 3 | "4B", 4 | "5B", 5 | "6B", 6 | "8B" 7 | ], 8 | "Difficulties": [ 9 | "NM", 10 | "HD", 11 | "MX" 12 | ], 13 | "Categories": [ 14 | "RP", 15 | "P1", 16 | "P2", 17 | "P3", 18 | "TR", 19 | "CE", 20 | "BS", 21 | "VE", 22 | "VE2", 23 | "VE3", 24 | "ES", 25 | "T1", 26 | "T2", 27 | "T3", 28 | "TQ", 29 | "GG", 30 | "CHU", 31 | "CY", 32 | "DM", 33 | "ESTI", 34 | "GC", 35 | "GF", 36 | "MD", 37 | "NXN" 38 | ], 39 | "Levels": [ 40 | 5, 41 | 10 42 | ], 43 | "ScLevels": [ 44 | 1, 45 | 1 46 | ], 47 | "IncludesFavorite": false 48 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/Preset/Ladder Match Season 8/Silver IV~II.json: -------------------------------------------------------------------------------- 1 | { 2 | "ButtonTunes": [ 3 | "4B", 4 | "5B", 5 | "6B", 6 | "8B" 7 | ], 8 | "Difficulties": [ 9 | "NM", 10 | "HD", 11 | "MX" 12 | ], 13 | "Categories": [ 14 | "RP", 15 | "P1", 16 | "P2", 17 | "P3", 18 | "TR", 19 | "CE", 20 | "BS", 21 | "VE", 22 | "VE2", 23 | "VE3", 24 | "ES", 25 | "T1", 26 | "T2", 27 | "T3", 28 | "TQ", 29 | "GG", 30 | "CHU", 31 | "CY", 32 | "DM", 33 | "ESTI", 34 | "GC", 35 | "GF", 36 | "MD", 37 | "NXN" 38 | ], 39 | "Levels": [ 40 | 7, 41 | 11 42 | ], 43 | "ScLevels": [ 44 | 1, 45 | 1 46 | ], 47 | "IncludesFavorite": false 48 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/Preset/Ladder Match Season 8/Gold I.json: -------------------------------------------------------------------------------- 1 | { 2 | "ButtonTunes": [ 3 | "4B", 4 | "5B", 5 | "6B", 6 | "8B" 7 | ], 8 | "Difficulties": [ 9 | "NM", 10 | "HD", 11 | "MX", 12 | "SC" 13 | ], 14 | "Categories": [ 15 | "RP", 16 | "P1", 17 | "P2", 18 | "P3", 19 | "TR", 20 | "CE", 21 | "BS", 22 | "VE", 23 | "VE2", 24 | "VE3", 25 | "ES", 26 | "T1", 27 | "T2", 28 | "T3", 29 | "TQ", 30 | "GG", 31 | "CHU", 32 | "CY", 33 | "DM", 34 | "ESTI", 35 | "GC", 36 | "GF", 37 | "MD", 38 | "NXN" 39 | ], 40 | "Levels": [ 41 | 11, 42 | 14 43 | ], 44 | "ScLevels": [ 45 | 2, 46 | 7 47 | ], 48 | "IncludesFavorite": false 49 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/Preset/Ladder Match Season 8/Gold IV.json: -------------------------------------------------------------------------------- 1 | { 2 | "ButtonTunes": [ 3 | "4B", 4 | "5B", 5 | "6B", 6 | "8B" 7 | ], 8 | "Difficulties": [ 9 | "NM", 10 | "HD", 11 | "MX", 12 | "SC" 13 | ], 14 | "Categories": [ 15 | "RP", 16 | "P1", 17 | "P2", 18 | "P3", 19 | "TR", 20 | "CE", 21 | "BS", 22 | "VE", 23 | "VE2", 24 | "VE3", 25 | "ES", 26 | "T1", 27 | "T2", 28 | "T3", 29 | "TQ", 30 | "GG", 31 | "CHU", 32 | "CY", 33 | "DM", 34 | "ESTI", 35 | "GC", 36 | "GF", 37 | "MD", 38 | "NXN" 39 | ], 40 | "Levels": [ 41 | 9, 42 | 12 43 | ], 44 | "ScLevels": [ 45 | 1, 46 | 3 47 | ], 48 | "IncludesFavorite": false 49 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/Preset/Ladder Match Season 8/Master.json: -------------------------------------------------------------------------------- 1 | { 2 | "ButtonTunes": [ 3 | "4B", 4 | "5B", 5 | "6B", 6 | "8B" 7 | ], 8 | "Difficulties": [ 9 | "NM", 10 | "HD", 11 | "MX", 12 | "SC" 13 | ], 14 | "Categories": [ 15 | "RP", 16 | "P1", 17 | "P2", 18 | "P3", 19 | "TR", 20 | "CE", 21 | "BS", 22 | "VE", 23 | "VE2", 24 | "VE3", 25 | "ES", 26 | "T1", 27 | "T2", 28 | "T3", 29 | "TQ", 30 | "GG", 31 | "CHU", 32 | "CY", 33 | "DM", 34 | "ESTI", 35 | "GC", 36 | "GF", 37 | "MD", 38 | "NXN" 39 | ], 40 | "Levels": [ 41 | 15, 42 | 15 43 | ], 44 | "ScLevels": [ 45 | 10, 46 | 15 47 | ], 48 | "IncludesFavorite": false 49 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/Preset/Ladder Match Season 8/Silver I.json: -------------------------------------------------------------------------------- 1 | { 2 | "ButtonTunes": [ 3 | "4B", 4 | "5B", 5 | "6B", 6 | "8B" 7 | ], 8 | "Difficulties": [ 9 | "NM", 10 | "HD", 11 | "MX", 12 | "SC" 13 | ], 14 | "Categories": [ 15 | "RP", 16 | "P1", 17 | "P2", 18 | "P3", 19 | "TR", 20 | "CE", 21 | "BS", 22 | "VE", 23 | "VE2", 24 | "VE3", 25 | "ES", 26 | "T1", 27 | "T2", 28 | "T3", 29 | "TQ", 30 | "GG", 31 | "CHU", 32 | "CY", 33 | "DM", 34 | "ESTI", 35 | "GC", 36 | "GF", 37 | "MD", 38 | "NXN" 39 | ], 40 | "Levels": [ 41 | 8, 42 | 12 43 | ], 44 | "ScLevels": [ 45 | 1, 46 | 3 47 | ], 48 | "IncludesFavorite": false 49 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/Preset/Ladder Match Season 8/Diamond I.json: -------------------------------------------------------------------------------- 1 | { 2 | "ButtonTunes": [ 3 | "4B", 4 | "5B", 5 | "6B", 6 | "8B" 7 | ], 8 | "Difficulties": [ 9 | "NM", 10 | "HD", 11 | "MX", 12 | "SC" 13 | ], 14 | "Categories": [ 15 | "RP", 16 | "P1", 17 | "P2", 18 | "P3", 19 | "TR", 20 | "CE", 21 | "BS", 22 | "VE", 23 | "VE2", 24 | "VE3", 25 | "ES", 26 | "T1", 27 | "T2", 28 | "T3", 29 | "TQ", 30 | "GG", 31 | "CHU", 32 | "CY", 33 | "DM", 34 | "ESTI", 35 | "GC", 36 | "GF", 37 | "MD", 38 | "NXN" 39 | ], 40 | "Levels": [ 41 | 14, 42 | 15 43 | ], 44 | "ScLevels": [ 45 | 7, 46 | 15 47 | ], 48 | "IncludesFavorite": false 49 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/Preset/Ladder Match Season 8/Gold III~II.json: -------------------------------------------------------------------------------- 1 | { 2 | "ButtonTunes": [ 3 | "4B", 4 | "5B", 5 | "6B", 6 | "8B" 7 | ], 8 | "Difficulties": [ 9 | "NM", 10 | "HD", 11 | "MX", 12 | "SC" 13 | ], 14 | "Categories": [ 15 | "RP", 16 | "P1", 17 | "P2", 18 | "P3", 19 | "TR", 20 | "CE", 21 | "BS", 22 | "VE", 23 | "VE2", 24 | "VE3", 25 | "ES", 26 | "T1", 27 | "T2", 28 | "T3", 29 | "TQ", 30 | "GG", 31 | "CHU", 32 | "CY", 33 | "DM", 34 | "ESTI", 35 | "GC", 36 | "GF", 37 | "MD", 38 | "NXN" 39 | ], 40 | "Levels": [ 41 | 9, 42 | 13 43 | ], 44 | "ScLevels": [ 45 | 1, 46 | 5 47 | ], 48 | "IncludesFavorite": false 49 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/Preset/Ladder Match Season 8/Platinum I.json: -------------------------------------------------------------------------------- 1 | { 2 | "ButtonTunes": [ 3 | "4B", 4 | "5B", 5 | "6B", 6 | "8B" 7 | ], 8 | "Difficulties": [ 9 | "NM", 10 | "HD", 11 | "MX", 12 | "SC" 13 | ], 14 | "Categories": [ 15 | "RP", 16 | "P1", 17 | "P2", 18 | "P3", 19 | "TR", 20 | "CE", 21 | "BS", 22 | "VE", 23 | "VE2", 24 | "VE3", 25 | "ES", 26 | "T1", 27 | "T2", 28 | "T3", 29 | "TQ", 30 | "GG", 31 | "CHU", 32 | "CY", 33 | "DM", 34 | "ESTI", 35 | "GC", 36 | "GF", 37 | "MD", 38 | "NXN" 39 | ], 40 | "Levels": [ 41 | 12, 42 | 15 43 | ], 44 | "ScLevels": [ 45 | 4, 46 | 11 47 | ], 48 | "IncludesFavorite": false 49 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/Preset/Ladder Match Season 8/Platinum II.json: -------------------------------------------------------------------------------- 1 | { 2 | "ButtonTunes": [ 3 | "4B", 4 | "5B", 5 | "6B", 6 | "8B" 7 | ], 8 | "Difficulties": [ 9 | "NM", 10 | "HD", 11 | "MX", 12 | "SC" 13 | ], 14 | "Categories": [ 15 | "RP", 16 | "P1", 17 | "P2", 18 | "P3", 19 | "TR", 20 | "CE", 21 | "BS", 22 | "VE", 23 | "VE2", 24 | "VE3", 25 | "ES", 26 | "T1", 27 | "T2", 28 | "T3", 29 | "TQ", 30 | "GG", 31 | "CHU", 32 | "CY", 33 | "DM", 34 | "ESTI", 35 | "GC", 36 | "GF", 37 | "MD", 38 | "NXN" 39 | ], 40 | "Levels": [ 41 | 12, 42 | 14 43 | ], 44 | "ScLevels": [ 45 | 4, 46 | 11 47 | ], 48 | "IncludesFavorite": false 49 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/Preset/Ladder Match Season 8/Platinum III.json: -------------------------------------------------------------------------------- 1 | { 2 | "ButtonTunes": [ 3 | "4B", 4 | "5B", 5 | "6B", 6 | "8B" 7 | ], 8 | "Difficulties": [ 9 | "NM", 10 | "HD", 11 | "MX", 12 | "SC" 13 | ], 14 | "Categories": [ 15 | "RP", 16 | "P1", 17 | "P2", 18 | "P3", 19 | "TR", 20 | "CE", 21 | "BS", 22 | "VE", 23 | "VE2", 24 | "VE3", 25 | "ES", 26 | "T1", 27 | "T2", 28 | "T3", 29 | "TQ", 30 | "GG", 31 | "CHU", 32 | "CY", 33 | "DM", 34 | "ESTI", 35 | "GC", 36 | "GF", 37 | "MD", 38 | "NXN" 39 | ], 40 | "Levels": [ 41 | 12, 42 | 14 43 | ], 44 | "ScLevels": [ 45 | 4, 46 | 9 47 | ], 48 | "IncludesFavorite": false 49 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/Preset/Ladder Match Season 8/Platinum IV.json: -------------------------------------------------------------------------------- 1 | { 2 | "ButtonTunes": [ 3 | "4B", 4 | "5B", 5 | "6B", 6 | "8B" 7 | ], 8 | "Difficulties": [ 9 | "NM", 10 | "HD", 11 | "MX", 12 | "SC" 13 | ], 14 | "Categories": [ 15 | "RP", 16 | "P1", 17 | "P2", 18 | "P3", 19 | "TR", 20 | "CE", 21 | "BS", 22 | "VE", 23 | "VE2", 24 | "VE3", 25 | "ES", 26 | "T1", 27 | "T2", 28 | "T3", 29 | "TQ", 30 | "GG", 31 | "CHU", 32 | "CY", 33 | "DM", 34 | "ESTI", 35 | "GC", 36 | "GF", 37 | "MD", 38 | "NXN" 39 | ], 40 | "Levels": [ 41 | 11, 42 | 14 43 | ], 44 | "ScLevels": [ 45 | 2, 46 | 9 47 | ], 48 | "IncludesFavorite": false 49 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Models/VArchivePatternItem.cs: -------------------------------------------------------------------------------- 1 | using Caliburn.Micro; 2 | 3 | namespace DjmaxRandomSelectorV.Models 4 | { 5 | public class VArchivePatternItem : PropertyChangedBase 6 | { 7 | private bool _isChecked = false; 8 | public bool IsChecked 9 | { 10 | get => _isChecked; 11 | set 12 | { 13 | _isChecked = value; 14 | NotifyOfPropertyChange(); 15 | } 16 | } 17 | public int Id { get; init; } 18 | public string Style { get; init; } 19 | public string Title { get; init; } 20 | public double Floor { get; init; } 21 | public double? Score { get; init; } 22 | public bool? IsMaxCombo { get; init; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/Preset/Ladder Match Season 8/Diamond IV~II.json: -------------------------------------------------------------------------------- 1 | { 2 | "ButtonTunes": [ 3 | "4B", 4 | "5B", 5 | "6B", 6 | "8B" 7 | ], 8 | "Difficulties": [ 9 | "NM", 10 | "HD", 11 | "MX", 12 | "SC" 13 | ], 14 | "Categories": [ 15 | "RP", 16 | "P1", 17 | "P2", 18 | "P3", 19 | "TR", 20 | "CE", 21 | "BS", 22 | "VE", 23 | "VE2", 24 | "VE3", 25 | "ES", 26 | "T1", 27 | "T2", 28 | "T3", 29 | "TQ", 30 | "GG", 31 | "CHU", 32 | "CY", 33 | "DM", 34 | "ESTI", 35 | "GC", 36 | "GF", 37 | "MD", 38 | "NXN" 39 | ], 40 | "Levels": [ 41 | 13, 42 | 15 43 | ], 44 | "ScLevels": [ 45 | 4, 46 | 11 47 | ], 48 | "IncludesFavorite": false 49 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Views/VArchiveWizardView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Shapes; 14 | 15 | namespace DjmaxRandomSelectorV.Views 16 | { 17 | /// 18 | /// VArchiveWizardView.xaml에 대한 상호 작용 논리 19 | /// 20 | public partial class VArchiveWizardView : Window 21 | { 22 | public VArchiveWizardView() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Views/FavoriteView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace DjmaxRandomSelectorV.Views 17 | { 18 | /// 19 | /// FavoriteView.xaml에 대한 상호 작용 논리 20 | /// 21 | public partial class FavoriteView : Window 22 | { 23 | public FavoriteView() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Views/BasicFilterView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace DjmaxRandomSelectorV.Views 17 | { 18 | /// 19 | /// BasicFilterView.xaml에 대한 상호 작용 논리 20 | /// 21 | public partial class BasicFilterView : UserControl 22 | { 23 | public BasicFilterView() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Views/FilterOptionView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace DjmaxRandomSelectorV.Views 17 | { 18 | /// 19 | /// FilterOptionView.xaml에 대한 상호 작용 논리 20 | /// 21 | public partial class FilterOptionView : UserControl 22 | { 23 | public FilterOptionView() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Views/AdvancedFilterView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace DjmaxRandomSelectorV.Views 17 | { 18 | /// 19 | /// AdvancedFilterView.xaml에 대한 상호 작용 논리 20 | /// 21 | public partial class AdvancedFilterView : UserControl 22 | { 23 | public AdvancedFilterView() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Views/FilterOptionIndicatorView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace DjmaxRandomSelectorV.Views 17 | { 18 | /// 19 | /// AddonView.xaml에 대한 상호 작용 논리 20 | /// 21 | public partial class FilterOptionIndicatorView : UserControl 22 | { 23 | public FilterOptionIndicatorView() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/CategoryContainer.cs: -------------------------------------------------------------------------------- 1 | using DjmaxRandomSelectorV.Models; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace DjmaxRandomSelectorV 6 | { 7 | public class CategoryContainer 8 | { 9 | private List _categories; 10 | 11 | public List GetCategories() 12 | { 13 | return _categories.ConvertAll(x => x); 14 | } 15 | 16 | public void SetCategories(Dmrsv3AppData appData) 17 | { 18 | var categories = appData.Categories.Where(cat => cat.Type != 3); 19 | var plis = appData.PliCategories 20 | .SelectMany(pli => pli.Minors, (pli, m) => new Category(m.Name, $"{pli.Major}:{m.Name}", null, 3)); 21 | _categories = new List(categories.Union(plis)); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/App.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Dmrsv.RandomSelector/Enums/Difficulty.cs: -------------------------------------------------------------------------------- 1 | namespace Dmrsv.RandomSelector.Enums 2 | { 3 | public enum Difficulty 4 | { 5 | Normal, 6 | Hard, 7 | Maximum, 8 | SC 9 | } 10 | 11 | public static class DifficultyExtensions 12 | { 13 | public static string AsString(this Difficulty difficulty) => difficulty switch 14 | { 15 | Difficulty.Normal => "NM", 16 | Difficulty.Hard => "HD", 17 | Difficulty.Maximum => "MX", 18 | Difficulty.SC => "SC", 19 | _ => throw new NotSupportedException("Invalid Difficulty") 20 | }; 21 | 22 | public static Difficulty AsDifficulty(this string str) => str switch 23 | { 24 | "NM" => Difficulty.Normal, 25 | "HD" => Difficulty.Hard, 26 | "MX" => Difficulty.Maximum, 27 | "SC" => Difficulty.SC, 28 | _ => throw new NotSupportedException("Invalid Difficulty") 29 | }; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Dmrsv.RandomSelector/Enums/ButtonTunes.cs: -------------------------------------------------------------------------------- 1 | namespace Dmrsv.RandomSelector.Enums 2 | { 3 | public enum ButtonTunes 4 | { 5 | Four = 4, 6 | Five = 5, 7 | Six = 6, 8 | Eight = 8 9 | } 10 | 11 | public static class ButtonTunesExtensions 12 | { 13 | public static string AsString(this ButtonTunes buttonTunes) => buttonTunes switch 14 | { 15 | ButtonTunes.Four => "4B", 16 | ButtonTunes.Five => "5B", 17 | ButtonTunes.Six => "6B", 18 | ButtonTunes.Eight => "8B", 19 | _ => throw new NotSupportedException("Invalid ButtonTunes") 20 | }; 21 | 22 | public static ButtonTunes AsButtonTunes(this string str) => str switch 23 | { 24 | "4B" => ButtonTunes.Four, 25 | "5B" => ButtonTunes.Five, 26 | "6B" => ButtonTunes.Six, 27 | "8B" => ButtonTunes.Eight, 28 | _ => throw new NotSupportedException("Invalid ButtonTunes") 29 | }; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/WindowTitleHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Text; 4 | 5 | namespace DjmaxRandomSelectorV 6 | { 7 | public class WindowTitleHelper 8 | { 9 | private const string DjmaxTitle = "DJMAX RESPECT V"; 10 | 11 | public bool EqualsDjmax() 12 | { 13 | return GetActiveWindowTitle().Equals(DjmaxTitle); 14 | } 15 | 16 | private string GetActiveWindowTitle() 17 | { 18 | const int nChars = 256; 19 | var Buff = new StringBuilder(nChars); 20 | IntPtr handle = GetForegroundWindow(); 21 | 22 | if (GetWindowText(handle, Buff, nChars) > 0) 23 | { 24 | return Buff.ToString(); 25 | } 26 | return string.Empty; 27 | } 28 | 29 | [DllImport("user32.dll")] 30 | private static extern int GetWindowText(IntPtr hWnd, StringBuilder text, int count); 31 | [DllImport("user32.dll")] 32 | private static extern IntPtr GetForegroundWindow(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Models/ListUpdater.cs: -------------------------------------------------------------------------------- 1 | using Caliburn.Micro; 2 | using System.Collections.Generic; 3 | 4 | namespace DjmaxRandomSelectorV.Models 5 | { 6 | public class ListUpdater : PropertyChangedBase 7 | { 8 | private readonly string _name; 9 | private readonly string _value; 10 | private readonly ICollection _target; 11 | 12 | public string Name { get => _name; } 13 | public bool IsValueContained 14 | { 15 | get => _target.Contains(_value); 16 | set 17 | { 18 | if (value) 19 | { 20 | _target.Add(_value); 21 | } 22 | else 23 | { 24 | _target.Remove(_value); 25 | } 26 | NotifyOfPropertyChange(); 27 | } 28 | } 29 | 30 | public ListUpdater(string name, string value, ICollection target) 31 | { 32 | _name = name; 33 | _value = value; 34 | _target = target; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 이 코드는 도구를 사용하여 생성되었습니다. 4 | // 런타임 버전:4.0.30319.42000 5 | // 6 | // 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 7 | // 이러한 변경 내용이 손실됩니다. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace DjmaxRandomSelectorV.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.3.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Dmrsv.RandomSelector/AdvancedFilter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | using System.Text.Json.Serialization; 3 | 4 | namespace Dmrsv.RandomSelector 5 | { 6 | public class AdvancedFilter : FilterBase 7 | { 8 | private ObservableCollection _patternList; 9 | 10 | public ObservableCollection PatternList 11 | { 12 | get => _patternList; 13 | set 14 | { 15 | _patternList = value; 16 | _patternList.CollectionChanged += (s, e) => IsUpdated = true; 17 | } 18 | } 19 | 20 | public AdvancedFilter() 21 | { 22 | _patternList = new ObservableCollection(); 23 | _patternList.CollectionChanged += (s, e) => IsUpdated = true; 24 | } 25 | 26 | public override IEnumerable Filter(IEnumerable trackList) 27 | { 28 | var result = from pattern in _patternList 29 | where trackList.Any(track => track.Id == pattern.Info.Id) 30 | select pattern; 31 | IsUpdated = false; 32 | return result; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Dmrsv.RandomSelector/SelectorWithHistory.cs: -------------------------------------------------------------------------------- 1 | namespace Dmrsv.RandomSelector 2 | { 3 | public class SelectorWithHistory : SelectorBase 4 | { 5 | public IHistory History { get; set; } 6 | 7 | public SelectorWithHistory(IHistory recent) 8 | { 9 | History = recent; 10 | } 11 | 12 | public override Pattern? Select(IList patternList) 13 | { 14 | var recentExcluded = from p in patternList 15 | where !History.Contains(p.TrackId) 16 | select p; 17 | 18 | while (!recentExcluded.Any() && History.Count > 0) 19 | { 20 | int trackId = History.Dequeue(); 21 | recentExcluded = from p in patternList 22 | where p.TrackId == trackId 23 | select p; 24 | } 25 | 26 | var selected = base.Select(recentExcluded.ToList()); 27 | 28 | if (selected is not null) 29 | { 30 | History.Enqueue(selected.TrackId); 31 | } 32 | 33 | return selected; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/DjmaxRandomSelectorV.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 12.00 2 | # Visual Studio Version 17 3 | VisualStudioVersion = 17.5.2.0 4 | MinimumVisualStudioVersion = 10.0.40219.1 5 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DjmaxRandomSelectorV", "DjmaxRandomSelectorV.csproj", "{51276AA4-2EEC-51EE-9EE2-9EEDB67A0986}" 6 | EndProject 7 | Global 8 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 9 | Debug|Any CPU = Debug|Any CPU 10 | Release|Any CPU = Release|Any CPU 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {51276AA4-2EEC-51EE-9EE2-9EEDB67A0986}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 14 | {51276AA4-2EEC-51EE-9EE2-9EEDB67A0986}.Debug|Any CPU.Build.0 = Debug|Any CPU 15 | {51276AA4-2EEC-51EE-9EE2-9EEDB67A0986}.Release|Any CPU.ActiveCfg = Release|Any CPU 16 | {51276AA4-2EEC-51EE-9EE2-9EEDB67A0986}.Release|Any CPU.Build.0 = Release|Any CPU 17 | EndGlobalSection 18 | GlobalSection(SolutionProperties) = preSolution 19 | HideSolutionNode = FALSE 20 | EndGlobalSection 21 | GlobalSection(ExtensibilityGlobals) = postSolution 22 | SolutionGuid = {68B8E5C5-23D3-4A92-A6AC-4E45B96DFE10} 23 | EndGlobalSection 24 | EndGlobal 25 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Dmrsv3Configuration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Dmrsv.RandomSelector; 4 | 5 | namespace DjmaxRandomSelectorV 6 | { 7 | public class Dmrsv3Configuration 8 | { 9 | /*************** Setting *****************/ 10 | public FilterType FilterType { get; set; } = FilterType.Query; 11 | public int InputDelay { get; set; } = 30; 12 | public List Favorite { get; set; } = new(); 13 | public List Blacklist { get; set; } = new(); 14 | public List OwnedDlcs { get; set; } = new(); 15 | public bool SavesRecents { get; set; } = false; 16 | public List RecentPlayed { get; set; } = new(); 17 | public uint StartKeyCode { get; set; } = 118; 18 | 19 | /*************** Filter Option *****************/ 20 | public int RecentsCount { get; set; } = 5; 21 | public MusicForm Mode { get; set; } = MusicForm.Default; 22 | public InputMethod Aider { get; set; } = InputMethod.Default; 23 | public LevelPreference Level { get; set; } = LevelPreference.None; 24 | 25 | 26 | /*************** Window Property *****************/ 27 | public double[] Position { get; set; } = Array.Empty(); 28 | public double[] Size { get; set; } = Array.Empty(); 29 | 30 | 31 | /*************** Version Info *****************/ 32 | public long AllTrackVersion { get; set; } = 0; 33 | public string AppdataVersion { get; set; } = string.Empty; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/FileManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Net.Http; 4 | using System.Text.Json; 5 | using System.Threading.Tasks; 6 | 7 | namespace DjmaxRandomSelectorV 8 | { 9 | public interface IFileManager 10 | { 11 | T Import(string path); 12 | void Export(T instance, string path); 13 | Task RequestAsync(string url); 14 | void Write(string content, string path); 15 | } 16 | 17 | public class FileManager : IFileManager 18 | { 19 | public T Import(string path) 20 | { 21 | using var reader = new StreamReader(path); 22 | string json = reader.ReadToEnd(); 23 | var option = new JsonSerializerOptions(JsonSerializerDefaults.Web); 24 | T instance = JsonSerializer.Deserialize(json, option); 25 | 26 | return instance ?? throw new NullReferenceException(); 27 | } 28 | 29 | public void Export(T instance, string path) 30 | { 31 | var option = new JsonSerializerOptions(JsonSerializerDefaults.Web); 32 | string json = JsonSerializer.Serialize(instance, option); 33 | Write(json, path); 34 | } 35 | 36 | public async Task RequestAsync(string url) 37 | { 38 | using var client = new HttpClient(); 39 | string result = await client.GetStringAsync(url); 40 | return result; 41 | } 42 | 43 | public void Write(string content, string path) 44 | { 45 | using var writer = new StreamWriter(path); 46 | writer.Write(content); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Dmrsv.RandomSelector/PatternPicker.cs: -------------------------------------------------------------------------------- 1 | namespace Dmrsv.RandomSelector 2 | { 3 | public class PatternPicker 4 | { 5 | private Func, IEnumerable>? pickMethod; 6 | 7 | public PatternPicker() 8 | { 9 | pickMethod = null; 10 | } 11 | 12 | public IEnumerable Pick(IEnumerable patternList) 13 | { 14 | return pickMethod?.Invoke(patternList) ?? patternList; 15 | } 16 | 17 | public void SetPickMethod(MusicForm form, LevelPreference preference) 18 | { 19 | pickMethod = (form, preference) switch 20 | { 21 | (MusicForm.Free, _) => (patternList) => 22 | { 23 | return from p in patternList 24 | group p by new { p.TrackId } into g 25 | select g.First(); 26 | } 27 | , 28 | (MusicForm.Default, LevelPreference.Lowest) => (patternList) => 29 | { 30 | return from p in patternList 31 | group p by new { p.TrackId, p.Button } into g 32 | select g.First(); 33 | } 34 | , 35 | (MusicForm.Default, LevelPreference.Highest) => (patternList) => 36 | { 37 | return from p in patternList 38 | group p by new { p.TrackId, p.Button } into g 39 | select g.Last(); 40 | } 41 | , 42 | _ => null 43 | }; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Dmrsv.RandomSelector/History.cs: -------------------------------------------------------------------------------- 1 | namespace Dmrsv.RandomSelector 2 | { 3 | public class History : IHistory 4 | { 5 | private readonly Queue _history; 6 | private int _capacity; 7 | 8 | public int Capacity 9 | { 10 | get => _capacity; 11 | set 12 | { 13 | _capacity = value; 14 | ResolveOverflow(); 15 | } 16 | } 17 | public int Count => _history.Count; 18 | 19 | public History(IEnumerable? recent = null, int capacity = 5) 20 | { 21 | _history = new Queue(recent ?? Array.Empty()); 22 | Capacity = capacity; 23 | ResolveOverflow(); 24 | } 25 | 26 | public void Enqueue(T item) 27 | { 28 | _history.Enqueue(item); 29 | if (_history.Count > Capacity) 30 | { 31 | _history.Dequeue(); 32 | } 33 | } 34 | 35 | public T Dequeue() 36 | { 37 | return _history.Dequeue(); 38 | } 39 | 40 | public bool Contains(T item) 41 | { 42 | return _history.Contains(item); 43 | } 44 | 45 | public void Clear() 46 | { 47 | _history.Clear(); 48 | } 49 | 50 | public IEnumerable GetItems() 51 | { 52 | return _history.Select(x => x); 53 | } 54 | 55 | private void ResolveOverflow() 56 | { 57 | int over = _history.Count - _capacity; 58 | for (int i = 0; i < over; i++) 59 | { 60 | _history.Dequeue(); 61 | } 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.32112.339 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DjmaxRandomSelectorV", "DjmaxRandomSelectorV\DjmaxRandomSelectorV.csproj", "{9E7B4681-5399-4F1F-BE21-49CCA80C088F}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dmrsv.RandomSelector", "Dmrsv.RandomSelector\Dmrsv.RandomSelector.csproj", "{3BB18A30-684D-433A-8A79-9D98F95ABADA}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {9E7B4681-5399-4F1F-BE21-49CCA80C088F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {9E7B4681-5399-4F1F-BE21-49CCA80C088F}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {9E7B4681-5399-4F1F-BE21-49CCA80C088F}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {9E7B4681-5399-4F1F-BE21-49CCA80C088F}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {3BB18A30-684D-433A-8A79-9D98F95ABADA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {3BB18A30-684D-433A-8A79-9D98F95ABADA}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {3BB18A30-684D-433A-8A79-9D98F95ABADA}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {3BB18A30-684D-433A-8A79-9D98F95ABADA}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {EE689C1A-9B9F-4F36-8178-4DD2A561C3A6} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/ViewModels/InfoViewModel.cs: -------------------------------------------------------------------------------- 1 | using Caliburn.Micro; 2 | using System; 3 | using System.Diagnostics; 4 | using System.Globalization; 5 | 6 | namespace DjmaxRandomSelectorV.ViewModels 7 | { 8 | public class InfoViewModel : Screen 9 | { 10 | private const string GITHUB_PAGE_URL = "https://github.com/wowvv0w/djmax-random-selector-v"; 11 | private const string BUG_REPORT_URL = "https://github.com/wowvv0w/djmax-random-selector-v/issues"; 12 | 13 | public string CurrentVersion { get; } 14 | public string LastestVersion { get; } 15 | public string AllTrackVersion { get; } 16 | public string AppdataVersion { get; } 17 | 18 | public InfoViewModel() 19 | { 20 | var container = IoC.Get(); 21 | CurrentVersion = "Current Version: " + container.CurrentAppVersion.ToString(3); 22 | LastestVersion = "Lastest Version: " + container.LatestAppVersion.ToString(3); 23 | AllTrackVersion = "All Track Last Updated : " + DateTime.ParseExact(container.AllTrackVersion.ToString(), 24 | "yyMMddHHmm", 25 | CultureInfo.InvariantCulture); 26 | AppdataVersion = "Appdata Version : " + container.AppdataVersion; 27 | } 28 | 29 | public void OpenGithubPage() 30 | { 31 | Process.Start("explorer.exe", GITHUB_PAGE_URL); 32 | } 33 | 34 | public void OpenBugReport() 35 | { 36 | Process.Start("explorer.exe", BUG_REPORT_URL); 37 | } 38 | 39 | public void CloseDialog() 40 | { 41 | TryCloseAsync(); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/ViewModels/MainViewModel.cs: -------------------------------------------------------------------------------- 1 | using Caliburn.Micro; 2 | using DjmaxRandomSelectorV.Messages; 3 | using Dmrsv.RandomSelector; 4 | using System; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | 8 | namespace DjmaxRandomSelectorV.ViewModels 9 | { 10 | public class MainViewModel : Conductor.Collection.OneActive, IHandle 11 | { 12 | private readonly IEventAggregator _eventAggregator; 13 | 14 | public MainViewModel(IEventAggregator eventAggregator) 15 | { 16 | _eventAggregator = eventAggregator; 17 | _eventAggregator.SubscribeOnUIThread(this); 18 | 19 | var type = GetFilterPanelType(IoC.Get().FilterType); 20 | ActivateItemAsync(IoC.GetInstance(type, null)); 21 | ActivateItemAsync(IoC.Get()); 22 | ChangeActiveItemAsync(Items[0], false); 23 | } 24 | 25 | public Task HandleAsync(SettingMessage message, CancellationToken cancellationToken) 26 | { 27 | var type = GetFilterPanelType(message.FilterType); 28 | if (type != Items[0].GetType()) 29 | { 30 | DeactivateItemAsync(Items[0], true, cancellationToken); 31 | Items.Insert(0, IoC.GetInstance(type, null)); 32 | ActivateItemAsync(Items[0], cancellationToken); 33 | } 34 | return Task.CompletedTask; 35 | } 36 | 37 | private Type GetFilterPanelType(FilterType filterType) => filterType switch 38 | { 39 | FilterType.Query => typeof(BasicFilterViewModel), 40 | FilterType.Playlist => typeof(AdvancedFilterViewModel), 41 | _ => throw new NotSupportedException(), 42 | }; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/Playlist/Boss Songs.json: -------------------------------------------------------------------------------- 1 | { 2 | "Playlist": [ 3 | { 4 | "Title": "Daylight", 5 | "Style": "4BSC" 6 | }, 7 | { 8 | "Title": "HAMSIN", 9 | "Style": "4BSC" 10 | }, 11 | { 12 | "Title": "Nightmare", 13 | "Style": "4BSC" 14 | }, 15 | { 16 | "Title": "PUPA", 17 | "Style": "4BSC" 18 | }, 19 | { 20 | "Title": "Zero-Break", 21 | "Style": "4BSC" 22 | }, 23 | { 24 | "Title": "Fundamental", 25 | "Style": "5BSC" 26 | }, 27 | { 28 | "Title": "Ikazuchi", 29 | "Style": "5BSC" 30 | }, 31 | { 32 | "Title": "Nightmare", 33 | "Style": "5BSC" 34 | }, 35 | { 36 | "Title": "PUPA", 37 | "Style": "5BSC" 38 | }, 39 | { 40 | "Title": "We\u0027re All Gonna Die", 41 | "Style": "5BSC" 42 | }, 43 | { 44 | "Title": "ANiMA", 45 | "Style": "6BSC" 46 | }, 47 | { 48 | "Title": "Odysseus", 49 | "Style": "6BSC" 50 | }, 51 | { 52 | "Title": "ouroboros -twin stroke of the end-", 53 | "Style": "6BSC" 54 | }, 55 | { 56 | "Title": "PUPA", 57 | "Style": "6BSC" 58 | }, 59 | { 60 | "Title": "Zero-Break", 61 | "Style": "6BSC" 62 | }, 63 | { 64 | "Title": "Fundamental", 65 | "Style": "8BSC" 66 | }, 67 | { 68 | "Title": "Nevermind", 69 | "Style": "8BSC" 70 | }, 71 | { 72 | "Title": "Nightmare", 73 | "Style": "8BSC" 74 | }, 75 | { 76 | "Title": "Odysseus", 77 | "Style": "8BSC" 78 | }, 79 | { 80 | "Title": "Road Of Death", 81 | "Style": "8BSC" 82 | }, 83 | { 84 | "Title": "We\u0027re All Gonna Die", 85 | "Style": "8BSC" 86 | }, 87 | { 88 | "Title": "Xeus", 89 | "Style": "8BSC" 90 | }, 91 | { 92 | "Title": "Zero-Break", 93 | "Style": "8BSC" 94 | } 95 | ] 96 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Runtime.Versioning; 6 | using System.Windows; 7 | 8 | [assembly: SupportedOSPlatform("windows7.0")] 9 | 10 | // 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해 11 | // 제어됩니다. 어셈블리와 관련된 정보를 수정하려면 12 | // 이러한 특성 값을 변경하세요. 13 | [assembly: AssemblyTitle("DjmaxRandomSelectorV")] 14 | [assembly: AssemblyDescription("")] 15 | [assembly: AssemblyConfiguration("")] 16 | [assembly: AssemblyCompany("")] 17 | [assembly: AssemblyProduct("DjmaxRandomSelectorV")] 18 | [assembly: AssemblyCopyright("Copyright © 2022")] 19 | [assembly: AssemblyTrademark("")] 20 | [assembly: AssemblyCulture("")] 21 | 22 | // ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에 23 | // 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면 24 | // 해당 형식에 대해 ComVisible 특성을 true로 설정하세요. 25 | [assembly: ComVisible(false)] 26 | 27 | //지역화 가능 애플리케이션 빌드를 시작하려면 다음을 설정하세요. 28 | //.csproj 파일에서 내에 CultureYouAreCodingWith를 29 | //설정하십시오. 예를 들어 소스 파일에서 영어(미국)를 30 | //사용하는 경우 를 en-US로 설정합니다. 그런 다음 아래 31 | //NeutralResourceLanguage 특성의 주석 처리를 제거합니다. 아래 줄의 "en-US"를 업데이트하여 32 | //프로젝트 파일의 UICulture 설정과 일치시킵니다. 33 | 34 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 35 | 36 | 37 | [assembly: ThemeInfo( 38 | ResourceDictionaryLocation.None, //테마별 리소스 사전의 위치 39 | //(페이지 또는 응용 프로그램 리소스 사진에 40 | // 리소스가 없는 경우에 사용됨) 41 | ResourceDictionaryLocation.SourceAssembly //제네릭 리소스 사전의 위치 42 | //(페이지 또는 응용 프로그램 리소스 사진에 43 | // 리소스가 없는 경우에 사용됨) 44 | )] 45 | 46 | 47 | // 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다. 48 | // 49 | // 주 버전 50 | // 부 버전 51 | // 빌드 번호 52 | // 수정 버전 53 | // 54 | // 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를 55 | // 기본값으로 할 수 있습니다. 56 | // [assembly: AssemblyVersion("1.0.*")] 57 | [assembly: AssemblyVersion("3.1.0")] 58 | -------------------------------------------------------------------------------- /Dmrsv.RandomSelector/TitleComparer.cs: -------------------------------------------------------------------------------- 1 | namespace Dmrsv.RandomSelector 2 | { 3 | public class TitleComparer : IComparer 4 | { 5 | public int Compare(string? x, string? y) 6 | { 7 | if (string.Equals(x, y)) 8 | { 9 | return 0; 10 | } 11 | if (y == null) 12 | { 13 | return -1; 14 | } 15 | if (x == null) 16 | { 17 | return 1; 18 | } 19 | // Djmax sorts titles with case-insensitive and ignoring the characters below 20 | x = x.Replace("'", string.Empty).Replace("-", string.Empty).ToUpper(); 21 | y = y.Replace("'", string.Empty).Replace("-", string.Empty).ToUpper(); 22 | int index = x.Zip(y, (a, b) => a == b).TakeWhile(equals => equals).Count(); 23 | if (index == Math.Min(x.Length, y.Length)) 24 | { 25 | return x.Length - y.Length; 26 | } 27 | // priority order: white-space -> non-alphabetic letter -> special character -> number -> alphabet 28 | char a = x[index], b = y[index]; 29 | int priorityA = GetPriority(a, index); 30 | int priorityB = GetPriority(b, index); 31 | if (priorityA == priorityB) 32 | { 33 | return a.CompareTo(b); 34 | } 35 | return priorityA - priorityB; 36 | } 37 | 38 | private int GetPriority(char ch, int idx) 39 | { 40 | if (char.IsWhiteSpace(ch)) 41 | { 42 | return 0; 43 | } 44 | if (char.IsUpper(ch)) // alphabet 45 | { 46 | return 4; 47 | } 48 | if (char.IsLetter(ch)) // non-alphabetic letter 49 | { 50 | return idx == 0 ? 1 : 5; 51 | } 52 | if (char.IsDigit(ch)) 53 | { 54 | return 3; 55 | } 56 | // symbol, punctuation, etc. 57 | return 2; 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Data/Playlist/Popular Songs.json: -------------------------------------------------------------------------------- 1 | { 2 | "Playlist": [ 3 | { 4 | "Title": "\uC548\uC544\uC918", 5 | "Style": "5BMX" 6 | }, 7 | { 8 | "Title": "Apparition", 9 | "Style": "4BSC" 10 | }, 11 | { 12 | "Title": "Arcade Love (feat. KNVWN)", 13 | "Style": "5BHD" 14 | }, 15 | { 16 | "Title": "Boom!", 17 | "Style": "6BMX" 18 | }, 19 | { 20 | "Title": "Daydream", 21 | "Style": "5BHD" 22 | }, 23 | { 24 | "Title": "Don\u0027t Die", 25 | "Style": "8BHD" 26 | }, 27 | { 28 | "Title": "Dream it", 29 | "Style": "4BMX" 30 | }, 31 | { 32 | "Title": "Fallin\u0027 in LUV", 33 | "Style": "8BMX" 34 | }, 35 | { 36 | "Title": "glory day", 37 | "Style": "5BSC" 38 | }, 39 | { 40 | "Title": "Imaginary dance", 41 | "Style": "5BMX" 42 | }, 43 | { 44 | "Title": "KICK IT", 45 | "Style": "8BSC" 46 | }, 47 | { 48 | "Title": "Melonaid", 49 | "Style": "4BHD" 50 | }, 51 | { 52 | "Title": "Move Yourself", 53 | "Style": "6BSC" 54 | }, 55 | { 56 | "Title": "NB RANGER - Virgin Force", 57 | "Style": "4BHD" 58 | }, 59 | { 60 | "Title": "NB RANGERS - \uC6B4\uBA85\uC758 Destiny", 61 | "Style": "4BMX" 62 | }, 63 | { 64 | "Title": "Never let you go", 65 | "Style": "8BMX" 66 | }, 67 | { 68 | "Title": "Odysseus", 69 | "Style": "4BHD" 70 | }, 71 | { 72 | "Title": "Only for you", 73 | "Style": "6BMX" 74 | }, 75 | { 76 | "Title": "Over Me", 77 | "Style": "5BHD" 78 | }, 79 | { 80 | "Title": "Sweet On You", 81 | "Style": "5BSC" 82 | }, 83 | { 84 | "Title": "The Raindrop Flower ~jam-jam Remix~", 85 | "Style": "4BHD" 86 | }, 87 | { 88 | "Title": "Tic! Tac! Toe!", 89 | "Style": "6BMX" 90 | }, 91 | { 92 | "Title": "U-NIVUS", 93 | "Style": "5BSC" 94 | }, 95 | { 96 | "Title": "welcome to the space (feat. Jisun)", 97 | "Style": "5BMX" 98 | }, 99 | { 100 | "Title": "Won\u0027t Back Down", 101 | "Style": "5BHD" 102 | } 103 | ] 104 | } -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/ViewModels/HistoryViewModel.cs: -------------------------------------------------------------------------------- 1 | using Caliburn.Micro; 2 | using DjmaxRandomSelectorV.Messages; 3 | using DjmaxRandomSelectorV.Models; 4 | using Dmrsv.RandomSelector; 5 | using System; 6 | using System.Linq; 7 | using System.Text.RegularExpressions; 8 | using System.Threading; 9 | using System.Threading.Tasks; 10 | 11 | namespace DjmaxRandomSelectorV.ViewModels 12 | { 13 | public class HistoryViewModel : Screen, IHandle, IHandle 14 | { 15 | private readonly IEventAggregator _eventAggregator; 16 | 17 | private int _number; 18 | private bool _showsStyle; 19 | 20 | public BindableCollection History { get; } 21 | 22 | public HistoryViewModel(IEventAggregator eventAggregator) 23 | { 24 | _eventAggregator = eventAggregator; 25 | _eventAggregator.SubscribeOnUIThread(this); 26 | _number = 0; 27 | History = new BindableCollection(); 28 | DisplayName = "HISTORY"; 29 | SetShowsStyle(IoC.Get().Mode); 30 | } 31 | 32 | private void AddItem(Pattern pattern) 33 | { 34 | _number++; 35 | var historyItem = new HistoryItem() 36 | { 37 | Number = _number, 38 | Info = pattern.Info, 39 | Category = pattern.Info.Category.Split(':')[0], 40 | Style = _showsStyle ? pattern.Style : "FREE", 41 | Level = _showsStyle ? pattern.Level.ToString() : "-", 42 | Time = new Regex(Regex.Escape(" ")).Replace(DateTime.Now.ToString("g"), "\n", 1), 43 | }; 44 | 45 | History.Insert(0, historyItem); 46 | if (History.Count > 10) 47 | { 48 | History.RemoveAt(10); 49 | } 50 | } 51 | 52 | public void ClearItems() 53 | { 54 | History.Clear(); 55 | _number = 0; 56 | } 57 | 58 | private void SetShowsStyle(MusicForm musicForm) 59 | { 60 | _showsStyle = musicForm == MusicForm.Default; 61 | } 62 | 63 | public Task HandleAsync(PatternMessage message, CancellationToken cancellationToken) 64 | { 65 | AddItem(message.Item); 66 | return Task.CompletedTask; 67 | } 68 | 69 | public Task HandleAsync(FilterOptionMessage message, CancellationToken cancellationToken) 70 | { 71 | SetShowsStyle(message.MusicForm); 72 | return Task.CompletedTask; 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/ViewModels/ShellViewModel.cs: -------------------------------------------------------------------------------- 1 | using Caliburn.Micro; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | 8 | namespace DjmaxRandomSelectorV.ViewModels 9 | { 10 | public class ShellViewModel : Conductor.Collection.AllActive 11 | { 12 | private readonly IEventAggregator _eventAggregator; 13 | private readonly IWindowManager _windowManager; 14 | 15 | public object MainPanel { get => Items[0]; } 16 | public object FilterOptionIndicator { get => Items[1]; } 17 | public object FilterOptionPanel { get => Items[2]; } 18 | public Visibility OpenReleasePageVisibility { get; } 19 | 20 | public ShellViewModel(IEventAggregator eventAggregator, IWindowManager windowManager) 21 | { 22 | _eventAggregator = eventAggregator; 23 | _eventAggregator.SubscribeOnUIThread(this); 24 | _windowManager = windowManager; 25 | 26 | var container = IoC.Get(); 27 | bool visible = container.CurrentAppVersion < container.LatestAppVersion; 28 | OpenReleasePageVisibility = visible ? Visibility.Visible : Visibility.Hidden; 29 | 30 | var childrenType = new List() 31 | { 32 | typeof(MainViewModel), 33 | typeof(FilterOptionIndicatorViewModel), 34 | typeof(FilterOptionViewModel) 35 | }; 36 | childrenType.ForEach(type => ActivateItemAsync(IoC.GetInstance(type, null))); 37 | } 38 | 39 | public void MoveWindow(object view) 40 | { 41 | var window = view as Window; 42 | window.DragMove(); 43 | } 44 | 45 | public void MinimizeWindow(object view) 46 | { 47 | var window = view as Window; 48 | window.WindowState = WindowState.Minimized; 49 | } 50 | 51 | public void CloseWindow(object view) 52 | { 53 | var window = view as Window; 54 | var config = IoC.Get(); 55 | config.Position = new double[2] { window.Top, window.Left }; 56 | window.Close(); 57 | } 58 | 59 | public void OpenReleasePage() 60 | { 61 | string url = "https://github.com/wowvv0w/djmax-random-selector-v/releases"; 62 | System.Diagnostics.Process.Start("explorer.exe", url); 63 | } 64 | 65 | public Task ShowInfoDialog() 66 | { 67 | return _windowManager.ShowDialogAsync(IoC.Get()); 68 | } 69 | 70 | public Task ShowSettingDialog() 71 | { 72 | return _windowManager.ShowDialogAsync(IoC.Get()); 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 이 코드는 도구를 사용하여 생성되었습니다. 4 | // 런타임 버전:4.0.30319.42000 5 | // 6 | // 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 7 | // 이러한 변경 내용이 손실됩니다. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace DjmaxRandomSelectorV.Properties 12 | { 13 | 14 | 15 | /// 16 | /// 지역화된 문자열 등을 찾기 위한 강력한 형식의 리소스 클래스입니다. 17 | /// 18 | // 이 클래스는 ResGen 또는 Visual Studio와 같은 도구를 통해 StronglyTypedResourceBuilder 19 | // 클래스에서 자동으로 생성되었습니다. 20 | // 멤버를 추가하거나 제거하려면 .ResX 파일을 편집한 다음 /str 옵션을 사용하여 21 | // ResGen을 다시 실행하거나 VS 프로젝트를 다시 빌드하십시오. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// 이 클래스에서 사용하는 캐시된 ResourceManager 인스턴스를 반환합니다. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DjmaxRandomSelectorV.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// 이 강력한 형식의 리소스 클래스를 사용하여 모든 리소스 조회에 대해 현재 스레드의 CurrentUICulture 속성을 56 | /// 재정의합니다. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/ExecutionHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Threading; 4 | using System.Threading.Tasks; 5 | using System.Windows.Interop; 6 | using Caliburn.Micro; 7 | using DjmaxRandomSelectorV.Messages; 8 | using Dmrsv.RandomSelector; 9 | using Action = System.Action; 10 | 11 | namespace DjmaxRandomSelectorV 12 | { 13 | public class ExecutionHelper : IHandle 14 | { 15 | private const int WM_HOTKEY = 0x0312; 16 | 17 | private readonly IEventAggregator _eventAggregator; 18 | 19 | private IntPtr _handle; 20 | private int _hotkeyID; 21 | private int _hotkeyWithShiftID; 22 | private uint _keyCode; 23 | 24 | private Func _canExecute; 25 | private Action _execute; 26 | private Action _executeAgain; 27 | 28 | public bool IgnoreCanExecute { get; set; } 29 | 30 | public ExecutionHelper(IEventAggregator eventAggregator) 31 | { 32 | _eventAggregator = eventAggregator; 33 | _eventAggregator.SubscribeOnUIThread(this); 34 | } 35 | 36 | public void Initialize(RandomSelector rs, Dmrsv3Configuration config) 37 | { 38 | _canExecute = rs.CanStart; 39 | _execute = rs.Start; 40 | _executeAgain = rs.StartAgain; 41 | IgnoreCanExecute = config.Aider == InputMethod.NotInput; 42 | } 43 | 44 | public void RegisterHandle(IntPtr handle) 45 | { 46 | HwndSource source = HwndSource.FromHwnd(handle); 47 | _handle = handle; 48 | source.AddHook(HwndHook); 49 | } 50 | 51 | public void SetHotkey(uint vk) 52 | { 53 | _keyCode = vk; 54 | _hotkeyID = 9000; 55 | _hotkeyWithShiftID = 9001; 56 | RegisterHotKey(_handle, _hotkeyID, (uint)KeyModifiers.None, vk); 57 | RegisterHotKey(_handle, _hotkeyWithShiftID, (uint)KeyModifiers.Alt, vk); 58 | } 59 | 60 | public Task HandleAsync(FilterOptionMessage message, CancellationToken cancellationToken) 61 | { 62 | IgnoreCanExecute = message.InputMethod == InputMethod.NotInput; 63 | return Task.CompletedTask; 64 | } 65 | 66 | public IntPtr HwndHook(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) 67 | { 68 | if (msg == WM_HOTKEY && (wParam.ToInt32() == _hotkeyID || wParam.ToInt32() == _hotkeyWithShiftID)) 69 | { 70 | int vkey = (int)lParam >> 16 & 0xFFFF; 71 | if (vkey == _keyCode) 72 | { 73 | if (IgnoreCanExecute || _canExecute.Invoke()) 74 | { 75 | var task = (KeyModifiers)((int)lParam & 0xFFFF) == KeyModifiers.Alt 76 | ? Task.Run(() => _executeAgain.Invoke()) 77 | : Task.Run(() => _execute.Invoke()); 78 | } 79 | } 80 | handled = true; 81 | } 82 | return IntPtr.Zero; 83 | } 84 | 85 | [DllImport("user32.dll")] 86 | private static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers, uint vk); 87 | 88 | public enum KeyModifiers 89 | { 90 | None = 0, 91 | Alt = 1, 92 | Control = 2, 93 | Shift = 4, 94 | Windows = 8 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Views/FilterOptionIndicatorView.xaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 14 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 39 | 40 | 41 | 42 | 43 | 51 | 52 | 53 | 54 | 55 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/ViewModels/FilterOptionViewModel.cs: -------------------------------------------------------------------------------- 1 | using Caliburn.Micro; 2 | using DjmaxRandomSelectorV.Messages; 3 | using Dmrsv.RandomSelector; 4 | using System.Collections.Generic; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | 8 | namespace DjmaxRandomSelectorV.ViewModels 9 | { 10 | public class FilterOptionViewModel : Conductor 11 | { 12 | private readonly Dictionary _modeItems = new() 13 | { 14 | [MusicForm.Default] = "FREESTYLE", 15 | [MusicForm.Free] = "ONLINE", 16 | }; 17 | private readonly Dictionary _aiderItems = new() 18 | { 19 | [InputMethod.Default] = "OFF", 20 | [InputMethod.WithAutoStart] = "AUTO START", 21 | [InputMethod.NotInput] = "OBSERVE", 22 | }; 23 | private readonly Dictionary _levelItems = new() 24 | { 25 | [LevelPreference.None] = "OFF", 26 | [LevelPreference.Lowest] = "BEGINNER", 27 | [LevelPreference.Highest] = "MASTER", 28 | }; 29 | private readonly IEventAggregator _eventAggregator; 30 | 31 | private int _except; 32 | private MusicForm _mode; 33 | private InputMethod _aider; 34 | private LevelPreference _level; 35 | 36 | public object FilterOptionIndicator { get => ActiveItem; } 37 | public int ExceptCount 38 | { 39 | get => _except; 40 | set 41 | { 42 | _except = value; 43 | NotifyOfPropertyChange(); 44 | Publish(new FilterOptionMessage(_except, _mode, _aider, _level)); 45 | } 46 | } 47 | public string ModeText { get => _modeItems[_mode]; } 48 | public string AiderText { get => _aiderItems[_aider]; } 49 | public string LevelText { get => _levelItems[_level]; } 50 | 51 | public FilterOptionViewModel(IEventAggregator eventAggregator) 52 | { 53 | _eventAggregator = eventAggregator; 54 | var config = IoC.Get(); 55 | _except = config.RecentsCount; 56 | _mode = config.Mode; 57 | _aider = config.Aider; 58 | _level = config.Level; 59 | ActivateItemAsync(IoC.Get()); 60 | } 61 | 62 | protected override Task OnDeactivateAsync(bool close, CancellationToken cancellationToken) 63 | { 64 | if (close) 65 | { 66 | var config = IoC.Get(); 67 | config.RecentsCount = _except; 68 | config.Mode = _mode; 69 | config.Aider = _aider; 70 | config.Level = _level; 71 | } 72 | return Task.CompletedTask; 73 | } 74 | 75 | private void Publish(object message) 76 | { 77 | _eventAggregator.PublishOnUIThreadAsync(message); 78 | } 79 | 80 | public void SwitchMode() 81 | { 82 | int value = (int)_mode; 83 | value ^= 0x1; 84 | _mode = (MusicForm)value; 85 | NotifyOfPropertyChange(nameof(ModeText)); 86 | Publish(new FilterOptionMessage(_except, _mode, _aider, _level)); 87 | } 88 | 89 | public void SwitchAider(int move) 90 | { 91 | int value = (int)_aider; 92 | value += move; 93 | value = (value % 3 + 3) % 3; 94 | _aider = (InputMethod)value; 95 | NotifyOfPropertyChange(nameof(AiderText)); 96 | Publish(new FilterOptionMessage(_except, _mode, _aider, _level)); 97 | } 98 | 99 | public void SwitchLevel(int move) 100 | { 101 | int value = (int)_level; 102 | value += move; 103 | value = (value % 3 + 3) % 3; 104 | _level = (LevelPreference)value; 105 | NotifyOfPropertyChange(nameof(LevelText)); 106 | Publish(new FilterOptionMessage(_except, _mode, _aider, _level)); 107 | } 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Views/MainView.xaml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 30 | 34 | 35 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/UpdateManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.IO; 5 | using System.Reflection; 6 | using System.Threading.Tasks; 7 | 8 | namespace DjmaxRandomSelectorV 9 | { 10 | public class UpdateManager 11 | { 12 | private const string VersionCheckUrl = "https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/main/DjmaxRandomSelectorV/Version3.txt"; 13 | private const string AllTrackDownloadUrl = "https://v-archive.net/db/songs.json"; 14 | private const string AppdataDownloadUrl = "https://raw.githubusercontent.com/wowvv0w/djmax-random-selector-v/main/DjmaxRandomSelectorV/DMRSV3_Data/appdata.json"; 15 | private const string AllTrackFilePath = @"DMRSV3_Data\AllTrackList.json"; 16 | private const string AppdataFilePath = @"DMRSV3_Data\appdata.json"; 17 | 18 | private readonly VersionContainer _container; 19 | private readonly IFileManager _fileManager; 20 | 21 | public UpdateManager(Dmrsv3Configuration config, VersionContainer container, IFileManager fileManager) 22 | { 23 | _container = container; 24 | _fileManager = fileManager; 25 | Version assemblyVersion = Assembly.GetEntryAssembly().GetName().Version; 26 | _container.CurrentAppVersion = _container.LatestAppVersion = assemblyVersion; 27 | _container.AllTrackVersion = config.AllTrackVersion; 28 | _container.AppdataVersion = config.AppdataVersion; 29 | } 30 | 31 | public async Task UpdateAsync() 32 | { 33 | string[] versions; // [ app version, appdata version, notice header, notice body ] 34 | try 35 | { 36 | string result = await _fileManager.RequestAsync(VersionCheckUrl); 37 | versions = result.Split('\n'); 38 | } 39 | catch 40 | { 41 | throw new Exception("Failed to check update."); 42 | } 43 | _container.LatestAppVersion = new Version(versions[0]); 44 | 45 | var tasks = new List>(); 46 | // update all track 47 | long now = long.Parse(DateTime.Now.ToString("yyMMddHHmm")); 48 | long past = _container.AllTrackVersion; 49 | if (now > past || !File.Exists(AllTrackFilePath)) 50 | { 51 | Debug.WriteLine("all track update start"); 52 | tasks.Add(DownloadAllTrackAsync()); 53 | } 54 | // update appdata 55 | if (!File.Exists(AllTrackFilePath) 56 | || versions[1].CompareTo(_container.AppdataVersion) > 0) 57 | { 58 | Debug.WriteLine("appdata update start"); 59 | tasks.Add(DownloadAppdataAsync()); 60 | } 61 | 62 | while (tasks.Count > 0) 63 | { 64 | var finishedTask = await Task.WhenAny(tasks); 65 | int result = await finishedTask; 66 | switch (result) 67 | { 68 | case 0: 69 | _container.AllTrackVersion = now; 70 | break; 71 | case 1: 72 | _container.AppdataVersion = versions[1]; 73 | break; 74 | } 75 | tasks.Remove(finishedTask); 76 | } 77 | } 78 | 79 | private async Task DownloadAllTrackAsync() 80 | { 81 | try 82 | { 83 | string result = await _fileManager.RequestAsync(AllTrackDownloadUrl); 84 | _fileManager.Write(result, AllTrackFilePath); 85 | } 86 | catch 87 | { 88 | return -1; 89 | } 90 | return 0; 91 | } 92 | 93 | private async Task DownloadAppdataAsync() 94 | { 95 | try 96 | { 97 | string result = await _fileManager.RequestAsync(AppdataDownloadUrl); 98 | _fileManager.Write(result, AppdataFilePath); 99 | } 100 | catch 101 | { 102 | return -1; 103 | } 104 | return 1; 105 | } 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/TrackDB.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Caliburn.Micro; 5 | using DjmaxRandomSelectorV.Models; 6 | using Dmrsv.RandomSelector; 7 | using Dmrsv.RandomSelector.Enums; 8 | 9 | namespace DjmaxRandomSelectorV 10 | { 11 | public class TrackDB 12 | { 13 | private const string AllTrackFilePath = @"DMRSV3_Data\AllTrackList.json"; 14 | 15 | private readonly IFileManager _fileManager; 16 | 17 | private string[] _basicCategories; 18 | private PliCategory[] _pliCategories; 19 | private LinkDiscItem[] _linkDisc; 20 | 21 | public IReadOnlyList AllTrack { get; private set; } 22 | 23 | public IEnumerable Playable => AllTrack.Where(t => t.IsPlayable); 24 | 25 | public TrackDB(IFileManager fileManager) 26 | { 27 | _fileManager = fileManager; 28 | } 29 | 30 | public void Initialize(Dmrsv3AppData appdata) 31 | { 32 | _basicCategories = appdata.BasicCategories; 33 | _pliCategories = appdata.PliCategories; 34 | _linkDisc = appdata.LinkDisc; 35 | } 36 | 37 | public void ImportDB() 38 | { 39 | var db = _fileManager.Import>(AllTrackFilePath); 40 | 41 | var pliDict = _pliCategories.ToDictionary(pli => pli.Major, pli => pli.Minors); 42 | string GetCategory(int id, string cat) 43 | { 44 | if (!pliDict.ContainsKey(cat)) 45 | { 46 | return cat; 47 | } 48 | foreach (var minor in pliDict[cat]) 49 | { 50 | if (minor.Items.Any(range => range[0] <= id && id <= range[1])) 51 | { 52 | return $"{cat}:{minor.Name}"; 53 | } 54 | } 55 | return cat; 56 | } 57 | 58 | AllTrack = db.ConvertAll(x => 59 | { 60 | var info = new MusicInfo() 61 | { 62 | Id = x.Title, 63 | Title = x.Name, 64 | Composer = x.Composer, 65 | Category = GetCategory(x.Title, x.DlcCode) 66 | }; 67 | return new Track() 68 | { 69 | Info = info, 70 | Patterns = x.Patterns 71 | .SelectMany(bt => bt.Value, (bt, df) => new Pattern() 72 | { 73 | Info = info, 74 | Button = bt.Key.AsButtonTunes(), 75 | Difficulty = df.Key.AsDifficulty(), 76 | Level = df.Value.Level 77 | }) 78 | .OrderBy(p => p.PatternId) 79 | .ToArray() 80 | }; 81 | }).AsReadOnly(); 82 | } 83 | 84 | public void SetPlayable(IEnumerable ownedDlcs) 85 | { 86 | var categories = ownedDlcs.Concat(_basicCategories); 87 | var exclusions = _linkDisc.Where(x => !x.RequiredDlc.Any(dlcs => dlcs.All(dlc => ownedDlcs.Contains(dlc)))) 88 | .Select(x => x.Id); 89 | AllTrack = AllTrack 90 | .Select(track => track with { IsPlayable = categories.Contains(track.Category) && !exclusions.Contains(track.Id) }) 91 | .ToList() 92 | .AsReadOnly(); 93 | } 94 | 95 | public record VArchiveDBTrack 96 | { 97 | public int Title { get; init; } 98 | public string Name { get; init; } 99 | public string Composer { get; init; } 100 | public string DlcCode { get; init; } 101 | public string Dlc { get; init; } 102 | public Dictionary> Patterns { get; init; } 103 | } 104 | 105 | public record VArchiveDBPattern 106 | { 107 | public int Level { get; init; } 108 | public double Floor { get; init; } 109 | public int Rating { get; init; } 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/ViewModels/SettingViewModel.cs: -------------------------------------------------------------------------------- 1 | using Caliburn.Micro; 2 | using DjmaxRandomSelectorV.Messages; 3 | using DjmaxRandomSelectorV.Models; 4 | using Dmrsv.RandomSelector; 5 | using Microsoft.Win32; 6 | using System.Collections.Generic; 7 | using System.IO; 8 | using System.Linq; 9 | using System.Windows; 10 | 11 | namespace DjmaxRandomSelectorV.ViewModels 12 | { 13 | public class SettingViewModel : Screen 14 | { 15 | private const string ConfigPath = @"DMRSV3_Data\Config.json"; 16 | private readonly IEventAggregator _eventAggregator; 17 | private readonly IFileManager _fileManager; 18 | private readonly SettingMessage _message; 19 | private readonly List _categories; 20 | 21 | public bool IsPlaylist 22 | { 23 | get { return _message.FilterType == FilterType.Playlist; } 24 | set 25 | { 26 | _message.FilterType = value ? FilterType.Playlist : FilterType.Query; 27 | NotifyOfPropertyChange(); 28 | } 29 | } 30 | public int InputDelay 31 | { 32 | get { return _message.InputInterval; } 33 | set 34 | { 35 | _message.InputInterval = value; 36 | NotifyOfPropertyChange(); 37 | } 38 | } 39 | public bool SavesRecents 40 | { 41 | get { return _message.SavesExclusion; } 42 | set 43 | { 44 | _message.SavesExclusion = value; 45 | NotifyOfPropertyChange(); 46 | } 47 | } 48 | public BindableCollection CategoryUpdaters { get; } 49 | 50 | public SettingViewModel(IEventAggregator eventAggregator, IFileManager fileManager) 51 | { 52 | _eventAggregator = eventAggregator; 53 | _fileManager = fileManager; 54 | 55 | var config = IoC.Get(); 56 | _message = new SettingMessage() 57 | { 58 | FilterType = config.FilterType, 59 | InputInterval = config.InputDelay, 60 | SavesExclusion = config.SavesRecents, 61 | OwnedDlcs = config.OwnedDlcs.ConvertAll(x => x) 62 | }; 63 | 64 | _categories = IoC.Get().GetCategories(); 65 | _categories.RemoveAll(x => string.IsNullOrEmpty(x.SteamId) && x.Type != 3); //TODO: use enum 66 | var updaters = _categories.ConvertAll(x => new ListUpdater(x.Name, x.Id, _message.OwnedDlcs)); 67 | CategoryUpdaters = new BindableCollection(updaters); 68 | } 69 | 70 | public void DetectDlcs() 71 | { 72 | Dictionary dlcCodes = _categories.Where(x => x.SteamId is not null).ToDictionary(x => x.SteamId, x => x.Id); 73 | 74 | var ownedDlcs = _message.OwnedDlcs; 75 | ownedDlcs.Clear(); 76 | 77 | string steamKeyName = @"HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Valve\Steam"; 78 | string steamPath = Registry.GetValue(steamKeyName, "InstallPath", null).ToString(); 79 | 80 | var libraryPath = new DirectoryInfo($"{steamPath}\\appcache\\librarycache"); 81 | 82 | foreach (DirectoryInfo dir in libraryPath.GetDirectories()) 83 | { 84 | string dlc = dlcCodes.GetValueOrDefault(dir.Name, null); 85 | if (!string.IsNullOrEmpty(dlc)) 86 | { 87 | ownedDlcs.Add(dlc); 88 | } 89 | } 90 | 91 | CategoryUpdaters.Refresh(); 92 | MessageBox.Show($"{ownedDlcs.Count} DLCs are detected.", 93 | "Notice", MessageBoxButton.OK, MessageBoxImage.Information); 94 | } 95 | 96 | public void Apply() 97 | { 98 | var config = IoC.Get(); 99 | config.FilterType = _message.FilterType; 100 | config.InputDelay = _message.InputInterval; 101 | config.SavesRecents = _message.SavesExclusion; 102 | config.OwnedDlcs = _message.OwnedDlcs.ConvertAll(x => x); 103 | 104 | _fileManager.Export(config, ConfigPath); 105 | _eventAggregator.PublishOnUIThreadAsync(_message); 106 | TryCloseAsync(true); 107 | } 108 | 109 | public void Cancel() 110 | { 111 | TryCloseAsync(false); 112 | } 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/ViewModels/FilterOptionIndicatorViewModel.cs: -------------------------------------------------------------------------------- 1 | using Caliburn.Micro; 2 | using DjmaxRandomSelectorV.Messages; 3 | using Dmrsv.RandomSelector; 4 | using System; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | using System.Windows.Media.Imaging; 8 | 9 | namespace DjmaxRandomSelectorV.ViewModels 10 | { 11 | public class FilterOptionIndicatorViewModel : Screen, IHandle 12 | { 13 | private readonly IEventAggregator _eventAggregator; 14 | 15 | private int _exceptCount; 16 | private BitmapImage _modeImage; 17 | private BitmapImage _aiderImage; 18 | private BitmapImage _levelImage; 19 | 20 | public int ExceptCount 21 | { 22 | get { return _exceptCount; } 23 | set 24 | { 25 | _exceptCount = value; 26 | NotifyOfPropertyChange(); 27 | } 28 | } 29 | public BitmapImage ModeImage 30 | { 31 | get { return _modeImage; } 32 | set 33 | { 34 | _modeImage = value; 35 | NotifyOfPropertyChange(); 36 | } 37 | } 38 | public BitmapImage AiderImage 39 | { 40 | get { return _aiderImage; } 41 | set 42 | { 43 | _aiderImage = value; 44 | NotifyOfPropertyChange(); 45 | } 46 | } 47 | public BitmapImage LevelImage 48 | { 49 | get { return _levelImage; } 50 | set 51 | { 52 | _levelImage = value; 53 | NotifyOfPropertyChange(); 54 | } 55 | } 56 | 57 | public FilterOptionIndicatorViewModel(IEventAggregator eventAggregator) 58 | { 59 | _eventAggregator = eventAggregator; 60 | _eventAggregator.SubscribeOnUIThread(this); 61 | 62 | var config = IoC.Get(); 63 | SetExceptCount(config.RecentsCount); 64 | SetModeImage(config.Mode); 65 | SetAiderImage(config.Mode, config.Aider); 66 | SetLevelImage(config.Mode, config.Level); 67 | } 68 | 69 | public Task HandleAsync(FilterOptionMessage message, CancellationToken cancellationToken) 70 | { 71 | SetExceptCount(message.RecentsCount); 72 | SetModeImage(message.MusicForm); 73 | SetAiderImage(message.MusicForm, message.InputMethod); 74 | SetLevelImage(message.MusicForm, message.LevelPreference); 75 | return Task.CompletedTask; 76 | } 77 | 78 | private void SetExceptCount(int value) 79 | { 80 | ExceptCount = value; 81 | } 82 | 83 | private void SetModeImage(MusicForm value) 84 | { 85 | ModeImage = GetBitmapImage(value switch 86 | { 87 | MusicForm.Default => "mode_fs", 88 | MusicForm.Free => "mode_on", 89 | _ => throw new NotImplementedException(), 90 | }); 91 | } 92 | 93 | private void SetAiderImage(MusicForm mValue, InputMethod aValue) 94 | { 95 | AiderImage = GetBitmapImage((mValue, aValue) switch 96 | { 97 | (_, InputMethod.Default) => "addon_none", 98 | (MusicForm.Default, InputMethod.WithAutoStart) => "aider_auto", 99 | (MusicForm.Free, InputMethod.WithAutoStart) => "aider_auto_locked", 100 | (_, InputMethod.NotInput) => "aider_observe", 101 | _ => throw new NotImplementedException(), 102 | }); 103 | } 104 | 105 | private void SetLevelImage(MusicForm mValue, LevelPreference lValue) 106 | { 107 | LevelImage = GetBitmapImage((mValue, lValue) switch 108 | { 109 | (_, LevelPreference.None) => "addon_none", 110 | (MusicForm.Default, LevelPreference.Lowest) => "level_beginner", 111 | (MusicForm.Default, LevelPreference.Highest) => "level_master", 112 | (MusicForm.Free, LevelPreference.Lowest) => "level_beginner_locked", 113 | (MusicForm.Free, LevelPreference.Highest) => "level_master_locked", 114 | _ => throw new NotImplementedException(), 115 | }); 116 | } 117 | 118 | private BitmapImage GetBitmapImage(string fileName) 119 | { 120 | return new BitmapImage(new Uri($"pack://application:,,,/Images/{fileName}.png")); 121 | } 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /DjmaxRandomSelectorV/Views/InfoView.xaml: -------------------------------------------------------------------------------- 1 | 14 | 15 | 17 | 19 | 20 | 22 |