예제 #1
0
        public override void UpdateItems()
        {
            items.Clear();
            Banshee.Index();

            Banshee.LoadVideos(out videos);
            Banshee.LoadPodcasts(out publishers);
            Banshee.LoadAlbumsAndArtists(out albums, out artists);

            foreach (Item video in videos)
            {
                items.Add(video);
            }
            foreach (Item album in albums)
            {
                items.Add(album);
            }
            foreach (Item artist in artists)
            {
                items.Add(artist);
            }
            foreach (Item podcast in publishers)
            {
                items.Add(podcast);
            }
        }
예제 #2
0
        public Game(Banshee _p, string mappath, int port = 6112)
        {
            p         = _p;
            entryKey  = (uint)new Random().Next();
            gameState = GameState.LOBBY;

            gameMap = new Map(mappath);
            slots   = gameMap.Slots.ToArray();

            randomseed = (uint)GetTimeMS();

            broadcastAddr = new IPEndPoint(IPAddress.Broadcast, 6112);
            tcpServer     = new TcpListener(IPAddress.Any, 6112);
            tcpServer.Server.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, 1);
            tcpServer.Start();

            x31CREATEGAME pkt = new x31CREATEGAME();

            pkt.product = "W3XP";
            pkt.version = 30;
            pkt.gameId  = id;
            p.sendUDPPacket(pkt, broadcastAddr);

            lobbyThread = new Thread(refreshThread);
            lobbyThread.Start();

            tcpThread = new Thread(listenTCP);
            tcpThread.Start();

            gameThread = new Thread(tickloop);
            gameThread.Start();
        }
예제 #3
0
        static void Main(string[] args)
        {
            //new Map(MAPPATH);
            Banshee b = new Banshee();

            CommandHandler.InitCommands();
        }
예제 #4
0
        public override IEnumerable <Item> Perform(IEnumerable <Item> items, IEnumerable <Item> modItems)
        {
            if (items.First() is MediaItem)
            {
                Banshee.Play(items.OfType <MediaItem> ().First());
            }
            else
            {
                Banshee.Play();
            }

            yield break;
        }
예제 #5
0
        public override IEnumerable <Item> Perform(IEnumerable <Item> items, IEnumerable <Item> modItems)
        {
            string pattern;

            if (items.First() is ITextItem)
            {
                pattern = (items.First() as ITextItem).Text;
            }
            else
            {
                pattern = items.First().Name;
            }

            Log <SearchCollectionAction> .Debug("Searching collection for {0}", pattern);

            return(Banshee.SearchMedia(pattern).Cast <Item> ());
        }
예제 #6
0
 protected override void Perform()
 {
     Banshee.Previous();
 }
예제 #7
0
        public override IEnumerable <Item> ChildrenOfItem(Item parent)
        {
            List <Item> children;

            children = new List <Item> ();

            if (parent is IApplicationItem && (parent as IApplicationItem).Exec.Contains("banshee-1"))
            {
                if (albums != null && albums.Count > 0)
                {
                    children.Add(new BrowseAlbumsMusicItem());
                }
                if (artists != null && artists.Count > 0)
                {
                    children.Add(new BrowseArtistMusicItem());
                }
                if (videos != null && videos.Count > 0)
                {
                    children.Add(new BrowseVideoItem());
                }
                if (publishers != null && publishers.Count > 0)
                {
                    children.Add(new BrowsePublisherPodcastItem());
                }
            }
            else if (parent is ArtistMusicItem)
            {
                foreach (AlbumMusicItem album in Banshee.LoadAlbumsFor(parent as ArtistMusicItem, albums))
                {
                    children.Add(album);
                }
            }
            else if (parent is AlbumMusicItem)
            {
                foreach (SongMusicItem song in Banshee.LoadMedia(parent as AlbumMusicItem))
                {
                    children.Add(song);
                }
            }
            else if (parent is PodcastPublisherItem)
            {
                foreach (PodcastPodcastItem pc in Banshee.LoadMedia(parent as PodcastPublisherItem))
                {
                    children.Add(pc);
                }
            }
            else if (parent is BrowsePublisherPodcastItem)
            {
                foreach (PodcastItem podcast in publishers)
                {
                    children.Add(podcast);
                }
            }
            else if (parent is BrowseVideoItem)
            {
                foreach (VideoItem video in videos)
                {
                    children.Add(video);
                }
            }
            else if (parent is BrowseAlbumsMusicItem)
            {
                foreach (AlbumMusicItem album in albums)
                {
                    children.Add(album);
                }
            }
            else if (parent is BrowseArtistMusicItem)
            {
                foreach (ArtistMusicItem artist in artists)
                {
                    children.Add(artist);
                }
            }

            return(children);
        }
예제 #8
0
 public override IEnumerable <Item> Perform(IEnumerable <Item> items, IEnumerable <Item> modItems)
 {
     items.Cast <MediaItem> ().ForEach(item => Banshee.Enqueue(item as MediaItem));
     yield break;
 }
예제 #9
0
 protected override void Perform()
 {
     Banshee.Next();
 }
예제 #10
0
 protected override void Perform()
 {
     Banshee.Pause();
 }