コード例 #1
0
        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);
            });
        }
コード例 #2
0
        public OptionsFrame(IAimpPlayer player, YouTubeDL ytb, Options options)
        {
            _player  = player;
            _ytb     = ytb;
            _options = options;

            _player.Core.RegisterExtension(this);
        }
コード例 #3
0
        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);
        }