public override void Initialize() { var dirAppData = Path.Combine(Player.Core.GetPath(AimpCorePathType.AIMP_CORE_PATH_PROFILE), _name); Directory.CreateDirectory(dirAppData); Trace.Listeners.Clear(); Trace.Listeners.Add(new Logger(dirAppData, _name)); AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; try { Player.MenuManager.GetBuiltIn(ParentMenuType.AIMP_MENUID_PLAYER_PLAYLIST_ADDING, out _); } catch (NullReferenceException ex) { Trace.Fail("MenuManager not available."); Trace.Fail(ex.ToString()); return; } Utils.TryCatch(() => { _options = Options.Load(dirAppData, _name); _ytb = new YouTubeDL(dirAppData, _options); if (_options.AutoUpdate) { _ytb.Update(); } _playback = new Playback(Player, _ytb); _optionsFrame = new OptionsFrame(Player, _ytb, _options); }); }
public OptionsFrame(IAimpPlayer player, YouTubeDL ytb, Options options) { _player = player; _ytb = ytb; _options = options; _player.Core.RegisterExtension(this); }
public Playback(IAimpPlayer player, YouTubeDL ytb) { _ytb = ytb; _player = player; _player.PlaybackQueueManager.OnCheckURL += PlaybackQueueManager_OnCheckURL; _player.MenuManager.GetBuiltIn(ParentMenuType.AIMP_MENUID_PLAYER_PLAYLIST_ADDING, out var menuParent); _player.MenuManager.CreateMenuItem(out var menuItem); menuItem.Name = "YouTube-DL"; menuItem.Parent = menuParent; menuItem.OnExecute += MenuItem_OnExecute; _player.MenuManager.Add(menuItem); }