You can subscribe to this list here.
| 2007 |
Jan
(36) |
Feb
(79) |
Mar
(123) |
Apr
(95) |
May
(119) |
Jun
(172) |
Jul
(124) |
Aug
(100) |
Sep
(83) |
Oct
(52) |
Nov
(97) |
Dec
(87) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(131) |
Feb
(80) |
Mar
(163) |
Apr
(178) |
May
(73) |
Jun
(54) |
Jul
(106) |
Aug
(118) |
Sep
(50) |
Oct
(125) |
Nov
(100) |
Dec
(99) |
| 2009 |
Jan
(104) |
Feb
(99) |
Mar
(68) |
Apr
(81) |
May
(52) |
Jun
(87) |
Jul
(67) |
Aug
(33) |
Sep
(27) |
Oct
(37) |
Nov
(60) |
Dec
(116) |
| 2010 |
Jan
(82) |
Feb
(79) |
Mar
(38) |
Apr
(50) |
May
(45) |
Jun
(53) |
Jul
(23) |
Aug
(86) |
Sep
(22) |
Oct
(96) |
Nov
(97) |
Dec
(73) |
| 2011 |
Jan
(24) |
Feb
(45) |
Mar
(28) |
Apr
(31) |
May
(42) |
Jun
(25) |
Jul
|
Aug
(12) |
Sep
(28) |
Oct
(13) |
Nov
(43) |
Dec
(13) |
| 2012 |
Jan
(62) |
Feb
(28) |
Mar
(6) |
Apr
(16) |
May
(7) |
Jun
|
Jul
(16) |
Aug
(2) |
Sep
(1) |
Oct
(4) |
Nov
(1) |
Dec
(3) |
| 2013 |
Jan
(5) |
Feb
|
Mar
(34) |
Apr
(9) |
May
(6) |
Jun
(10) |
Jul
(32) |
Aug
(8) |
Sep
(11) |
Oct
(35) |
Nov
(24) |
Dec
(22) |
| 2014 |
Jan
(44) |
Feb
(9) |
Mar
(9) |
Apr
(15) |
May
(25) |
Jun
(34) |
Jul
(16) |
Aug
(11) |
Sep
(7) |
Oct
(6) |
Nov
(1) |
Dec
(12) |
| 2015 |
Jan
(33) |
Feb
(19) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(5) |
|
From: <gre...@us...> - 2007-04-14 00:41:08
|
Revision: 322
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=322&view=rev
Author: gregmac45
Date: 2007-04-13 17:41:07 -0700 (Fri, 13 Apr 2007)
Log Message:
-----------
Copied remotely
Added Paths:
-----------
trunk/plugins/OnlineVideos/Skin/
Copied: trunk/plugins/OnlineVideos/Skin (from rev 321, trunk/plugins/Skin)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gre...@us...> - 2007-04-14 00:40:32
|
Revision: 321
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=321&view=rev
Author: gregmac45
Date: 2007-04-13 17:40:30 -0700 (Fri, 13 Apr 2007)
Log Message:
-----------
Removed file/folder
Removed Paths:
-------------
trunk/plugins/OnlineVideoSettings.xml
Deleted: trunk/plugins/OnlineVideoSettings.xml
===================================================================
--- trunk/plugins/OnlineVideoSettings.xml 2007-04-14 00:40:09 UTC (rev 320)
+++ trunk/plugins/OnlineVideoSettings.xml 2007-04-14 00:40:30 UTC (rev 321)
@@ -1,191 +0,0 @@
-<settings>
-<filter></filter><!-- comma delimited example: <filter>dog,cat,snake</filter> -->
-<thumbLocation>C:\OnlineVideoThumbnails\</thumbLocation>
-<sites>
-<site>
-<name>YouTube</name>
-<id>1</id>
-<!-- set the user if you wish to able to see youtube favorites -->
-<user></user>
-<!-- set the password if you wish to add/delete favorites to youtube -->
-<password></password>
-<!-- set the confirmAge to yes if you wish to confirm your age to view certain videos -->
-<confirmAge>no</confirmAge>
-<rss name="Top Rated"><![CDATA[http://youtube.com/rss/global/top_rated.rss]]></rss>
-<rss name="Recently Added"><![CDATA[http://youtube.com/rss/global/recently_added.rss]]></rss>
-<rss name="Recently Featured"><![CDATA[http://youtube.com/rss/global/recently_featured.rss]]></rss>
-<rss name="Top Favorites"><![CDATA[http://youtube.com/rss/global/top_favorites.rss]]></rss>
-<rss name="Top Viewed"><![CDATA[http://youtube.com/rss/global/top_viewed.rss]]></rss>
-<rss name="Top Viewed:Today"><![CDATA[http://youtube.com/rss/global/top_viewed_today.rss]]></rss>
-<rss name="Top Viewed:This Week"><![CDATA[http://youtube.com/rss/global/top_viewed_week.rss]]></rss>
-<rss name="Top Viewed:This Month"><![CDATA[http://youtube.com/rss/global/top_viewed_month.rss]]></rss>
-<rss name="Most Discussed:Today"><![CDATA[http://youtube.com/rss/global/most_discussed_today.rss]]></rss>
-<rss name="Most Discussed:This Week"><![CDATA[http://youtube.com/rss/global/most_discussed_week.rss]]></rss>
-<rss name="Most Discussed:This Month"><![CDATA[http://youtube.com/rss/global/most_discussed_month.rss]]></rss>
-<rss name="Search"><![CDATA[http://www.youtube.com/rss/tag/{0}.rss]]></rss>
-</site>
-<site>
-<name>Google Video</name>
-<id>2</id>
-<rss name="Popular"><![CDATA[http://video.google.com/videofeed?type=popular&num=100&output=rss]]></rss>
-<rss name="Random"><![CDATA[http://video.google.com/videofeed?type=random&num=100&output=rss]]></rss>
-<rss name="Comedy"><![CDATA[http://video.google.com/videofeed?type=search&q=genre:comedy&so=1&num=50]]></rss>
-<rss name="Music Video"><![CDATA[http://video.google.com/videofeed?type=search&q=type:music_video&so=1&num=50]]></rss>
-<rss name="Movie Trailer"><![CDATA[http://video.google.com/videofeed?type=search&q=type:movie_trailer&so=1&num=50]]></rss>
-<rss name="TV Show"><![CDATA[http://video.google.com/videofeed?type=search&q=type:tvshow&so=1&num=50]]></rss>
-<rss name="Sports"><![CDATA[http://video.google.com/videofeed?type=search&q=type:sports%20OR%20genre:sports&so=1&num=50]]></rss>
-<rss name="Educational"><![CDATA[http://video.google.com/videofeed?type=search&q=genre:educational&so=1&num=50]]></rss>
-<rss name="Google Picks"><![CDATA[http://video.google.com/videofeed?type=search&q=type:gpick&so=1&num=50]]></rss>
-<rss name="Search"><![CDATA[http://video.google.com/videofeed?type=search&q={0}&so=1&num=50]]></rss>
-</site>
-<site>
-<name>Grouper</name>
-<id>3</id>
-<rss name="Featured"><![CDATA[http://grouper.com/rss/media.ashx?o=0&t=1&fx=&fp=1]]></rss>
-<rss name="Newest"><![CDATA[http://www.grouper.com/rss/media.ashx?o=0&fx=]]></rss>
-<rss name="Most Viewed"><![CDATA[http://www.grouper.com/rss/media.ashx?o=1&t=1&fx=]]></rss>
-<rss name="Most Discussed"><![CDATA[http://www.grouper.com/rss/media.ashx?o=4&t=1&fx=]]></rss>
-<rss name="Highest Rated"><![CDATA[http://www.grouper.com/rss/media.ashx?o=3&fx=]]></rss>
-<rss name="Most Viral"><![CDATA[http://www.grouper.com/rss/media.ashx?o=6&fx=]]></rss>
-</site>
-<!-- NOT WORKING CURRENTLY. Videos don't always play.
-<site>
-<name>Guba</name>
-<id>4</id>
-<rss name="Action"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=562&o=0&set=5]]></rss>
-<rss name="Animation"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=457&o=0&set=5]]></rss>
-<rss name="Classics"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=807&o=0&set=5]]></rss>
-<rss name="Comedy"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=456&o=0&set=5]]></rss>
-<rss name="Documentary"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=460&o=0&set=5]]></rss>
-<rss name="Drama"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=459&o=0&set=5]]></rss>
-<rss name="Educational"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=513&o=0&set=5]]></rss>
-<rss name="Family"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=514&o=0&set=5]]></rss>
-<rss name="Foreign"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=463&o=0&set=5]]></rss>
-<rss name="Independent"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=515&o=0&set=5]]></rss>
-<rss name="Miscellaneous"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=458&o=0&set=5]]></rss>
-<rss name="Music Videos"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=462&o=0&set=5]]></rss>
-<rss name="Romance"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=516&o=0&set=5]]></rss>
-<rss name="Sports"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=461&o=0&set=5]]></rss>
-<rss name="TV Shows"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=806&o=0&set=5]]></rss>
-<rss name="Thriller"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=517&o=0&set=5]]></rss>
-</site>
--->
-<site>
-<name>MetaCafe</name>
-<id>5</id>
-<rss name="New Videos"><![CDATA[http://www.metacafe.com/rss/new_videos.rss]]></rss>
-</site>
-<site>
-<name>DailyMotion</name>
-<id>6</id>
-<rss name="Font Page"><![CDATA[http://www.dailymotion.com/rss]]></rss>
-<rss name="Ads"><![CDATA[http://www.dailymotion.com/rss/cluster/ads]]></rss>
-<rss name="Animals"><![CDATA[http://www.dailymotion.com/rss/cluster/animals]]></rss>
-<rss name="Fun"><![CDATA[http://www.dailymotion.com/rss/cluster/fun]]></rss>
-<rss name="Auto"><![CDATA[http://www.dailymotion.com/rss/cluster/auto]]></rss>
-<rss name="Street"><![CDATA[http://www.dailymotion.com/rss/cluster/street]]></rss>
-<rss name="Creation"><![CDATA[http://www.dailymotion.com/rss/cluster/creation]]></rss>
-<rss name="Short Films"><![CDATA[http://www.dailymotion.com/rss/cluster/shortfilms]]></rss>
-<rss name="Business"><![CDATA[http://www.dailymotion.com/rss/cluster/business]]></rss>
-<rss name="Tech"><![CDATA[http://www.dailymotion.com/rss/cluster/tech]]></rss>
-<rss name="Sport"><![CDATA[http://www.dailymotion.com/rss/cluster/sport]]></rss>
-<rss name="Extreme"><![CDATA[http://www.dailymotion.com/rss/cluster/extreme]]></rss>
-<rss name="Events"><![CDATA[http://www.dailymotion.com/rss/cluster/events]]></rss>
-<rss name="Family"><![CDATA[http://www.dailymotion.com/rss/cluster/family]]></rss>
-<rss name="Music"><![CDATA[http://www.dailymotion.com/rss/cluster/music]]></rss>
-<rss name="News"><![CDATA[http://www.dailymotion.com/rss/cluster/news]]></rss>
-<rss name="Parties"><![CDATA[http://www.dailymotion.com/rss/cluster/parties]]></rss>
-<rss name="School"><![CDATA[http://www.dailymotion.com/rss/cluster/school]]></rss>
-<rss name="Travel"><![CDATA[http://www.dailymotion.com/rss/cluster/travel]]></rss>
-<rss name="Video Games"><![CDATA[http://www.dailymotion.com/rss/cluster/videogames]]></rss>
-<rss name="Blog"><![CDATA[http://www.dailymotion.com/rss/cluster/blog]]></rss>
-<rss name="3D"><![CDATA[http://www.dailymotion.com/rss/cluster/3D]]></rss>
-<rss name="Dating"><![CDATA[http://www.dailymotion.com/rss/cluster/dating]]></rss>
-<rss name="Search"><![CDATA[http://www.dailymotion.com/rss/relevance/search/{0}]]></rss>
-</site>
-<!--
-<site>
-<name>ABC Online</name>
-<id>8</id>
-<rss name="videos" dynamic="yes"><![CDATA[http://ll.static.abc.com/streaming/s/catalog?aff=&isIE=true]]></rss>
-</site>
--->
-<site>
-<name>BlipTV</name>
-<id>9</id>
-<rss name="videos"><![CDATA[http://blip.tv/?1=1&search=soccer;page=1;s=posts&skin=rss]]></rss>
-</site>
-<!--
-<site>
-<name>CBS Innertube</name>
-<id>10</id>
-<rss name="videos" dynamic="yes"><![CDATA[http://www.cbs.com/xml2/browseMenu/76.xml]]></rss>
-</site>
--->
-<site>
-<name>GameTrailers</name>
-<id>11</id>
-<rss name="videos"><![CDATA[http://www.gametrailers.com/rss/newest.xml]]></rss>
-</site>
-<!--
-<site>
-<name>MSN SoapBox</name>
-<id>12</id>
-<rss name="videos"><![CDATA[http://soapbox.msn.com/rss.aspx?listId=mostpopular&categoryId=8118b646-92c6-4051-a1eb-40ef4ee49ec1]]></rss>
-</site>
--->
-<site>
-<name>Video Jug</name>
-<id>13</id>
-<rss name="videos"><![CDATA[http://www.videojug.com/rss]]></rss>
-</site>
-<site>
-<name>VidiLife</name>
-<id>14</id>
-<rss name="videos"><![CDATA[http://rss.vidilife.com/rss.aspx]]></rss>
-</site>
-<site>
-<name>Apple Trailers</name>
-<id>15</id>
-<rss name="New Trailers"><![CDATA[http://www.apple.com/moviesxml/h/view1_all.xml]]></rss>
-<rss name="Action and Adventure"><![CDATA[http://movies.apple.com/moviesxml/g/action_and_adventure_1.xml]]></rss>
-<rss name="Comedy"><![CDATA[http://movies.apple.com/moviesxml/g/comedy_1.xml]]></rss>
-<rss name="Documentary"><![CDATA[http://movies.apple.com/moviesxml/g/documentary_1.xml]]></rss>
-<rss name="Drama"><![CDATA[http://movies.apple.com/moviesxml/g/drama_1.xml]]></rss>
-<rss name="Family"><![CDATA[http://movies.apple.com/moviesxml/g/family_1.xml]]></rss>
-<rss name="Foreign"><![CDATA[http://movies.apple.com/moviesxml/g/fantasy_1.xml]]></rss>
-<rss name="Horror"><![CDATA[http://movies.apple.com/moviesxml/g/horror_1.xml]]></rss>
-<rss name="Musical"><![CDATA[http://movies.apple.com/moviesxml/g/musical_1.xml]]></rss>
-<rss name="Romance"><![CDATA[http://movies.apple.com/moviesxml/g/romance_1.xml]]></rss>
-<rss name="Sience Fiction"><![CDATA[http://movies.apple.com/moviesxml/g/science_fiction_1.xml]]></rss>
-<rss name="Thriller"><![CDATA[http://movies.apple.com/moviesxml/g/thriller_1.xml]]></rss>
-<rss name="20th Century Fox"><![CDATA[http://movies.apple.com/moviesxml/s/fox/index_1.xml]]></rss>
-<rss name="DreamWorks S.K.G"><![CDATA[http://movies.apple.com/moviesxml/s/dreamworks/index_1.xml]]></rss>
-<rss name="Focus Features / Rogue Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/focus_features/index_1.xml]]></rss>
-<rss name="Fox Searchlight Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/fox_searchlight/index_1.xml]]></rss>
-<rss name="Independent"><![CDATA[http://movies.apple.com/moviesxml/s/independent/index_1.xml]]></rss>
-<rss name="Lionsgate"><![CDATA[http://movies.apple.com/moviesxml/s/lions_gate/index_1.xml]]></rss>
-<rss name="MGM Studios"><![CDATA[http://movies.apple.com/moviesxml/s/mgm/index_1.xml]]></rss>
-<rss name="Magnolia Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/magnolia/index_1.xml]]></rss>
-<rss name="Miramax Films"><![CDATA[http://movies.apple.com/moviesxml/s/miramax/index_1.xml]]></rss>
-<rss name="New Line Cinema"><![CDATA[http://movies.apple.com/moviesxml/s/newline/index_1.xml]]></rss>
-<rss name="Paramount Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/paramount/index_1.xml]]></rss>
-<rss name="Paramount Vantage"><![CDATA[http://movies.apple.com/moviesxml/s/paramount_vantage/index_1.xml]]></rss>
-<rss name="Picturehouse"><![CDATA[http://movies.apple.com/moviesxml/s/picturehouse/index_1.xml]]></rss>
-<rss name="Rogue Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/rogue_pictures/index_1.xml]]></rss>
-<rss name="Sony Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/sony_pictures/index_1.xml]]></rss>
-<rss name="Sony Pictures Classics"><![CDATA[http://movies.apple.com/moviesxml/s/sony/index_1.xml]]></rss>
-<rss name="Touchstone Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/touchstone/index_1.xml]]></rss>
-<rss name="Universal Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/universal/index_1.xml]]></rss>
-<rss name="Walt Disney Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/disney/index_1.xml]]></rss>
-<rss name="Warner Bros. Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/wb/index_1.xml]]></rss>
-<rss name="Warner Independent Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/warner_independent_pictures/index_1.xml]]></rss>
-<rss name="Weinstein"><![CDATA[http://movies.apple.com/moviesxml/s/weinstein/index_1.xml]]></rss>
-</site>
-<site>
-<id>99</id>
-<name>Downloaded Videos</name>
-<rss name="Downloads"><![CDATA[C:\FlashVideos\]]></rss>
-</site>
-</sites>
-</settings>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gre...@us...> - 2007-04-14 00:40:12
|
Revision: 320
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=320&view=rev
Author: gregmac45
Date: 2007-04-13 17:40:09 -0700 (Fri, 13 Apr 2007)
Log Message:
-----------
Copied remotely
Added Paths:
-----------
trunk/plugins/OnlineVideos/OnlineVideoSettings.xml
Copied: trunk/plugins/OnlineVideos/OnlineVideoSettings.xml (from rev 319, trunk/plugins/OnlineVideoSettings.xml)
===================================================================
--- trunk/plugins/OnlineVideos/OnlineVideoSettings.xml (rev 0)
+++ trunk/plugins/OnlineVideos/OnlineVideoSettings.xml 2007-04-14 00:40:09 UTC (rev 320)
@@ -0,0 +1,191 @@
+<settings>
+<filter></filter><!-- comma delimited example: <filter>dog,cat,snake</filter> -->
+<thumbLocation>C:\OnlineVideoThumbnails\</thumbLocation>
+<sites>
+<site>
+<name>YouTube</name>
+<id>1</id>
+<!-- set the user if you wish to able to see youtube favorites -->
+<user></user>
+<!-- set the password if you wish to add/delete favorites to youtube -->
+<password></password>
+<!-- set the confirmAge to yes if you wish to confirm your age to view certain videos -->
+<confirmAge>no</confirmAge>
+<rss name="Top Rated"><![CDATA[http://youtube.com/rss/global/top_rated.rss]]></rss>
+<rss name="Recently Added"><![CDATA[http://youtube.com/rss/global/recently_added.rss]]></rss>
+<rss name="Recently Featured"><![CDATA[http://youtube.com/rss/global/recently_featured.rss]]></rss>
+<rss name="Top Favorites"><![CDATA[http://youtube.com/rss/global/top_favorites.rss]]></rss>
+<rss name="Top Viewed"><![CDATA[http://youtube.com/rss/global/top_viewed.rss]]></rss>
+<rss name="Top Viewed:Today"><![CDATA[http://youtube.com/rss/global/top_viewed_today.rss]]></rss>
+<rss name="Top Viewed:This Week"><![CDATA[http://youtube.com/rss/global/top_viewed_week.rss]]></rss>
+<rss name="Top Viewed:This Month"><![CDATA[http://youtube.com/rss/global/top_viewed_month.rss]]></rss>
+<rss name="Most Discussed:Today"><![CDATA[http://youtube.com/rss/global/most_discussed_today.rss]]></rss>
+<rss name="Most Discussed:This Week"><![CDATA[http://youtube.com/rss/global/most_discussed_week.rss]]></rss>
+<rss name="Most Discussed:This Month"><![CDATA[http://youtube.com/rss/global/most_discussed_month.rss]]></rss>
+<rss name="Search"><![CDATA[http://www.youtube.com/rss/tag/{0}.rss]]></rss>
+</site>
+<site>
+<name>Google Video</name>
+<id>2</id>
+<rss name="Popular"><![CDATA[http://video.google.com/videofeed?type=popular&num=100&output=rss]]></rss>
+<rss name="Random"><![CDATA[http://video.google.com/videofeed?type=random&num=100&output=rss]]></rss>
+<rss name="Comedy"><![CDATA[http://video.google.com/videofeed?type=search&q=genre:comedy&so=1&num=50]]></rss>
+<rss name="Music Video"><![CDATA[http://video.google.com/videofeed?type=search&q=type:music_video&so=1&num=50]]></rss>
+<rss name="Movie Trailer"><![CDATA[http://video.google.com/videofeed?type=search&q=type:movie_trailer&so=1&num=50]]></rss>
+<rss name="TV Show"><![CDATA[http://video.google.com/videofeed?type=search&q=type:tvshow&so=1&num=50]]></rss>
+<rss name="Sports"><![CDATA[http://video.google.com/videofeed?type=search&q=type:sports%20OR%20genre:sports&so=1&num=50]]></rss>
+<rss name="Educational"><![CDATA[http://video.google.com/videofeed?type=search&q=genre:educational&so=1&num=50]]></rss>
+<rss name="Google Picks"><![CDATA[http://video.google.com/videofeed?type=search&q=type:gpick&so=1&num=50]]></rss>
+<rss name="Search"><![CDATA[http://video.google.com/videofeed?type=search&q={0}&so=1&num=50]]></rss>
+</site>
+<site>
+<name>Grouper</name>
+<id>3</id>
+<rss name="Featured"><![CDATA[http://grouper.com/rss/media.ashx?o=0&t=1&fx=&fp=1]]></rss>
+<rss name="Newest"><![CDATA[http://www.grouper.com/rss/media.ashx?o=0&fx=]]></rss>
+<rss name="Most Viewed"><![CDATA[http://www.grouper.com/rss/media.ashx?o=1&t=1&fx=]]></rss>
+<rss name="Most Discussed"><![CDATA[http://www.grouper.com/rss/media.ashx?o=4&t=1&fx=]]></rss>
+<rss name="Highest Rated"><![CDATA[http://www.grouper.com/rss/media.ashx?o=3&fx=]]></rss>
+<rss name="Most Viral"><![CDATA[http://www.grouper.com/rss/media.ashx?o=6&fx=]]></rss>
+</site>
+<!-- NOT WORKING CURRENTLY. Videos don't always play.
+<site>
+<name>Guba</name>
+<id>4</id>
+<rss name="Action"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=562&o=0&set=5]]></rss>
+<rss name="Animation"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=457&o=0&set=5]]></rss>
+<rss name="Classics"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=807&o=0&set=5]]></rss>
+<rss name="Comedy"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=456&o=0&set=5]]></rss>
+<rss name="Documentary"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=460&o=0&set=5]]></rss>
+<rss name="Drama"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=459&o=0&set=5]]></rss>
+<rss name="Educational"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=513&o=0&set=5]]></rss>
+<rss name="Family"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=514&o=0&set=5]]></rss>
+<rss name="Foreign"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=463&o=0&set=5]]></rss>
+<rss name="Independent"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=515&o=0&set=5]]></rss>
+<rss name="Miscellaneous"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=458&o=0&set=5]]></rss>
+<rss name="Music Videos"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=462&o=0&set=5]]></rss>
+<rss name="Romance"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=516&o=0&set=5]]></rss>
+<rss name="Sports"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=461&o=0&set=5]]></rss>
+<rss name="TV Shows"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=806&o=0&set=5]]></rss>
+<rss name="Thriller"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=517&o=0&set=5]]></rss>
+</site>
+-->
+<site>
+<name>MetaCafe</name>
+<id>5</id>
+<rss name="New Videos"><![CDATA[http://www.metacafe.com/rss/new_videos.rss]]></rss>
+</site>
+<site>
+<name>DailyMotion</name>
+<id>6</id>
+<rss name="Font Page"><![CDATA[http://www.dailymotion.com/rss]]></rss>
+<rss name="Ads"><![CDATA[http://www.dailymotion.com/rss/cluster/ads]]></rss>
+<rss name="Animals"><![CDATA[http://www.dailymotion.com/rss/cluster/animals]]></rss>
+<rss name="Fun"><![CDATA[http://www.dailymotion.com/rss/cluster/fun]]></rss>
+<rss name="Auto"><![CDATA[http://www.dailymotion.com/rss/cluster/auto]]></rss>
+<rss name="Street"><![CDATA[http://www.dailymotion.com/rss/cluster/street]]></rss>
+<rss name="Creation"><![CDATA[http://www.dailymotion.com/rss/cluster/creation]]></rss>
+<rss name="Short Films"><![CDATA[http://www.dailymotion.com/rss/cluster/shortfilms]]></rss>
+<rss name="Business"><![CDATA[http://www.dailymotion.com/rss/cluster/business]]></rss>
+<rss name="Tech"><![CDATA[http://www.dailymotion.com/rss/cluster/tech]]></rss>
+<rss name="Sport"><![CDATA[http://www.dailymotion.com/rss/cluster/sport]]></rss>
+<rss name="Extreme"><![CDATA[http://www.dailymotion.com/rss/cluster/extreme]]></rss>
+<rss name="Events"><![CDATA[http://www.dailymotion.com/rss/cluster/events]]></rss>
+<rss name="Family"><![CDATA[http://www.dailymotion.com/rss/cluster/family]]></rss>
+<rss name="Music"><![CDATA[http://www.dailymotion.com/rss/cluster/music]]></rss>
+<rss name="News"><![CDATA[http://www.dailymotion.com/rss/cluster/news]]></rss>
+<rss name="Parties"><![CDATA[http://www.dailymotion.com/rss/cluster/parties]]></rss>
+<rss name="School"><![CDATA[http://www.dailymotion.com/rss/cluster/school]]></rss>
+<rss name="Travel"><![CDATA[http://www.dailymotion.com/rss/cluster/travel]]></rss>
+<rss name="Video Games"><![CDATA[http://www.dailymotion.com/rss/cluster/videogames]]></rss>
+<rss name="Blog"><![CDATA[http://www.dailymotion.com/rss/cluster/blog]]></rss>
+<rss name="3D"><![CDATA[http://www.dailymotion.com/rss/cluster/3D]]></rss>
+<rss name="Dating"><![CDATA[http://www.dailymotion.com/rss/cluster/dating]]></rss>
+<rss name="Search"><![CDATA[http://www.dailymotion.com/rss/relevance/search/{0}]]></rss>
+</site>
+<!--
+<site>
+<name>ABC Online</name>
+<id>8</id>
+<rss name="videos" dynamic="yes"><![CDATA[http://ll.static.abc.com/streaming/s/catalog?aff=&isIE=true]]></rss>
+</site>
+-->
+<site>
+<name>BlipTV</name>
+<id>9</id>
+<rss name="videos"><![CDATA[http://blip.tv/?1=1&search=soccer;page=1;s=posts&skin=rss]]></rss>
+</site>
+<!--
+<site>
+<name>CBS Innertube</name>
+<id>10</id>
+<rss name="videos" dynamic="yes"><![CDATA[http://www.cbs.com/xml2/browseMenu/76.xml]]></rss>
+</site>
+-->
+<site>
+<name>GameTrailers</name>
+<id>11</id>
+<rss name="videos"><![CDATA[http://www.gametrailers.com/rss/newest.xml]]></rss>
+</site>
+<!--
+<site>
+<name>MSN SoapBox</name>
+<id>12</id>
+<rss name="videos"><![CDATA[http://soapbox.msn.com/rss.aspx?listId=mostpopular&categoryId=8118b646-92c6-4051-a1eb-40ef4ee49ec1]]></rss>
+</site>
+-->
+<site>
+<name>Video Jug</name>
+<id>13</id>
+<rss name="videos"><![CDATA[http://www.videojug.com/rss]]></rss>
+</site>
+<site>
+<name>VidiLife</name>
+<id>14</id>
+<rss name="videos"><![CDATA[http://rss.vidilife.com/rss.aspx]]></rss>
+</site>
+<site>
+<name>Apple Trailers</name>
+<id>15</id>
+<rss name="New Trailers"><![CDATA[http://www.apple.com/moviesxml/h/view1_all.xml]]></rss>
+<rss name="Action and Adventure"><![CDATA[http://movies.apple.com/moviesxml/g/action_and_adventure_1.xml]]></rss>
+<rss name="Comedy"><![CDATA[http://movies.apple.com/moviesxml/g/comedy_1.xml]]></rss>
+<rss name="Documentary"><![CDATA[http://movies.apple.com/moviesxml/g/documentary_1.xml]]></rss>
+<rss name="Drama"><![CDATA[http://movies.apple.com/moviesxml/g/drama_1.xml]]></rss>
+<rss name="Family"><![CDATA[http://movies.apple.com/moviesxml/g/family_1.xml]]></rss>
+<rss name="Foreign"><![CDATA[http://movies.apple.com/moviesxml/g/fantasy_1.xml]]></rss>
+<rss name="Horror"><![CDATA[http://movies.apple.com/moviesxml/g/horror_1.xml]]></rss>
+<rss name="Musical"><![CDATA[http://movies.apple.com/moviesxml/g/musical_1.xml]]></rss>
+<rss name="Romance"><![CDATA[http://movies.apple.com/moviesxml/g/romance_1.xml]]></rss>
+<rss name="Sience Fiction"><![CDATA[http://movies.apple.com/moviesxml/g/science_fiction_1.xml]]></rss>
+<rss name="Thriller"><![CDATA[http://movies.apple.com/moviesxml/g/thriller_1.xml]]></rss>
+<rss name="20th Century Fox"><![CDATA[http://movies.apple.com/moviesxml/s/fox/index_1.xml]]></rss>
+<rss name="DreamWorks S.K.G"><![CDATA[http://movies.apple.com/moviesxml/s/dreamworks/index_1.xml]]></rss>
+<rss name="Focus Features / Rogue Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/focus_features/index_1.xml]]></rss>
+<rss name="Fox Searchlight Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/fox_searchlight/index_1.xml]]></rss>
+<rss name="Independent"><![CDATA[http://movies.apple.com/moviesxml/s/independent/index_1.xml]]></rss>
+<rss name="Lionsgate"><![CDATA[http://movies.apple.com/moviesxml/s/lions_gate/index_1.xml]]></rss>
+<rss name="MGM Studios"><![CDATA[http://movies.apple.com/moviesxml/s/mgm/index_1.xml]]></rss>
+<rss name="Magnolia Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/magnolia/index_1.xml]]></rss>
+<rss name="Miramax Films"><![CDATA[http://movies.apple.com/moviesxml/s/miramax/index_1.xml]]></rss>
+<rss name="New Line Cinema"><![CDATA[http://movies.apple.com/moviesxml/s/newline/index_1.xml]]></rss>
+<rss name="Paramount Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/paramount/index_1.xml]]></rss>
+<rss name="Paramount Vantage"><![CDATA[http://movies.apple.com/moviesxml/s/paramount_vantage/index_1.xml]]></rss>
+<rss name="Picturehouse"><![CDATA[http://movies.apple.com/moviesxml/s/picturehouse/index_1.xml]]></rss>
+<rss name="Rogue Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/rogue_pictures/index_1.xml]]></rss>
+<rss name="Sony Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/sony_pictures/index_1.xml]]></rss>
+<rss name="Sony Pictures Classics"><![CDATA[http://movies.apple.com/moviesxml/s/sony/index_1.xml]]></rss>
+<rss name="Touchstone Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/touchstone/index_1.xml]]></rss>
+<rss name="Universal Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/universal/index_1.xml]]></rss>
+<rss name="Walt Disney Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/disney/index_1.xml]]></rss>
+<rss name="Warner Bros. Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/wb/index_1.xml]]></rss>
+<rss name="Warner Independent Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/warner_independent_pictures/index_1.xml]]></rss>
+<rss name="Weinstein"><![CDATA[http://movies.apple.com/moviesxml/s/weinstein/index_1.xml]]></rss>
+</site>
+<site>
+<id>99</id>
+<name>Downloaded Videos</name>
+<rss name="Downloads"><![CDATA[C:\FlashVideos\]]></rss>
+</site>
+</sites>
+</settings>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gre...@us...> - 2007-04-14 00:39:43
|
Revision: 319
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=319&view=rev
Author: gregmac45
Date: 2007-04-13 17:39:42 -0700 (Fri, 13 Apr 2007)
Log Message:
-----------
Created folder remotely
Added Paths:
-----------
trunk/plugins/OnlineVideos/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gre...@us...> - 2007-04-14 00:36:09
|
Revision: 318
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=318&view=rev
Author: gregmac45
Date: 2007-04-13 17:36:06 -0700 (Fri, 13 Apr 2007)
Log Message:
-----------
Initial Import
Added Paths:
-----------
trunk/plugins/OnlineVideoSettings.xml
trunk/plugins/Skin/
trunk/plugins/Skin/BlueTwo/
trunk/plugins/Skin/BlueTwo/myonlinevideos.xml
trunk/plugins/Source/
trunk/plugins/Source/AbcUtil.cs
trunk/plugins/Source/AssemblyInfo.cs
trunk/plugins/Source/BlipTvUtil.cs
trunk/plugins/Source/BreakUtil.cs
trunk/plugins/Source/CbsUtil.cs
trunk/plugins/Source/DailyMotionUtil.cs
trunk/plugins/Source/DownloadedVideoUtil.cs
trunk/plugins/Source/FlashVideoScreen.cs
trunk/plugins/Source/GUIOnlineVideos.cs
trunk/plugins/Source/GameTrailersUtil.cs
trunk/plugins/Source/GoogleVideoUtil.cs
trunk/plugins/Source/GrouperUtil.cs
trunk/plugins/Source/GubaUtil.cs
trunk/plugins/Source/ImageDowloader.cs
trunk/plugins/Source/ItunesTrailerUtil.cs
trunk/plugins/Source/ItunesUtils/
trunk/plugins/Source/ItunesUtils/AppleTrailers.cs
trunk/plugins/Source/ItunesUtils/GUIQTTrailers.cs
trunk/plugins/Source/ItunesUtils/HDHelper.cs
trunk/plugins/Source/ItunesUtils/HttpReader.cs
trunk/plugins/Source/ItunesUtils/ItmsContent.cs
trunk/plugins/Source/ItunesUtils/ItmsHelper.cs
trunk/plugins/Source/ItunesUtils/RegexParsers.cs
trunk/plugins/Source/ItunesUtils/TrailerIndex.cs
trunk/plugins/Source/ItunesUtils/TrailerInfo.cs
trunk/plugins/Source/ItunesUtils/TrailerInfoCollection.cs
trunk/plugins/Source/ItunesUtils/TrailerStream.cs
trunk/plugins/Source/ItunesUtils/TrailerStreamCollection.cs
trunk/plugins/Source/Main.cs
trunk/plugins/Source/MetaCafeUtil.cs
trunk/plugins/Source/OnlineVideos.csproj
trunk/plugins/Source/OnlineVideos.csproj.user
trunk/plugins/Source/OnlineVideos.sln
trunk/plugins/Source/OnlineVideos.suo
trunk/plugins/Source/Properties/
trunk/plugins/Source/Properties/AssemblyInfo.cs
trunk/plugins/Source/Runner.csproj
trunk/plugins/Source/SiteUtilBase.cs
trunk/plugins/Source/SiteUtilFactory.cs
trunk/plugins/Source/SoapBoxUtil.cs
trunk/plugins/Source/VideoJugUtil.cs
trunk/plugins/Source/VidiLifeUtil.cs
trunk/plugins/Source/YouTubeUtil.cs
trunk/plugins/Source/bin/
trunk/plugins/Source/bin/Debug/
trunk/plugins/Source/obj/
trunk/plugins/Source/obj/Debug/
Added: trunk/plugins/OnlineVideoSettings.xml
===================================================================
--- trunk/plugins/OnlineVideoSettings.xml (rev 0)
+++ trunk/plugins/OnlineVideoSettings.xml 2007-04-14 00:36:06 UTC (rev 318)
@@ -0,0 +1,191 @@
+<settings>
+<filter></filter><!-- comma delimited example: <filter>dog,cat,snake</filter> -->
+<thumbLocation>C:\OnlineVideoThumbnails\</thumbLocation>
+<sites>
+<site>
+<name>YouTube</name>
+<id>1</id>
+<!-- set the user if you wish to able to see youtube favorites -->
+<user></user>
+<!-- set the password if you wish to add/delete favorites to youtube -->
+<password></password>
+<!-- set the confirmAge to yes if you wish to confirm your age to view certain videos -->
+<confirmAge>no</confirmAge>
+<rss name="Top Rated"><![CDATA[http://youtube.com/rss/global/top_rated.rss]]></rss>
+<rss name="Recently Added"><![CDATA[http://youtube.com/rss/global/recently_added.rss]]></rss>
+<rss name="Recently Featured"><![CDATA[http://youtube.com/rss/global/recently_featured.rss]]></rss>
+<rss name="Top Favorites"><![CDATA[http://youtube.com/rss/global/top_favorites.rss]]></rss>
+<rss name="Top Viewed"><![CDATA[http://youtube.com/rss/global/top_viewed.rss]]></rss>
+<rss name="Top Viewed:Today"><![CDATA[http://youtube.com/rss/global/top_viewed_today.rss]]></rss>
+<rss name="Top Viewed:This Week"><![CDATA[http://youtube.com/rss/global/top_viewed_week.rss]]></rss>
+<rss name="Top Viewed:This Month"><![CDATA[http://youtube.com/rss/global/top_viewed_month.rss]]></rss>
+<rss name="Most Discussed:Today"><![CDATA[http://youtube.com/rss/global/most_discussed_today.rss]]></rss>
+<rss name="Most Discussed:This Week"><![CDATA[http://youtube.com/rss/global/most_discussed_week.rss]]></rss>
+<rss name="Most Discussed:This Month"><![CDATA[http://youtube.com/rss/global/most_discussed_month.rss]]></rss>
+<rss name="Search"><![CDATA[http://www.youtube.com/rss/tag/{0}.rss]]></rss>
+</site>
+<site>
+<name>Google Video</name>
+<id>2</id>
+<rss name="Popular"><![CDATA[http://video.google.com/videofeed?type=popular&num=100&output=rss]]></rss>
+<rss name="Random"><![CDATA[http://video.google.com/videofeed?type=random&num=100&output=rss]]></rss>
+<rss name="Comedy"><![CDATA[http://video.google.com/videofeed?type=search&q=genre:comedy&so=1&num=50]]></rss>
+<rss name="Music Video"><![CDATA[http://video.google.com/videofeed?type=search&q=type:music_video&so=1&num=50]]></rss>
+<rss name="Movie Trailer"><![CDATA[http://video.google.com/videofeed?type=search&q=type:movie_trailer&so=1&num=50]]></rss>
+<rss name="TV Show"><![CDATA[http://video.google.com/videofeed?type=search&q=type:tvshow&so=1&num=50]]></rss>
+<rss name="Sports"><![CDATA[http://video.google.com/videofeed?type=search&q=type:sports%20OR%20genre:sports&so=1&num=50]]></rss>
+<rss name="Educational"><![CDATA[http://video.google.com/videofeed?type=search&q=genre:educational&so=1&num=50]]></rss>
+<rss name="Google Picks"><![CDATA[http://video.google.com/videofeed?type=search&q=type:gpick&so=1&num=50]]></rss>
+<rss name="Search"><![CDATA[http://video.google.com/videofeed?type=search&q={0}&so=1&num=50]]></rss>
+</site>
+<site>
+<name>Grouper</name>
+<id>3</id>
+<rss name="Featured"><![CDATA[http://grouper.com/rss/media.ashx?o=0&t=1&fx=&fp=1]]></rss>
+<rss name="Newest"><![CDATA[http://www.grouper.com/rss/media.ashx?o=0&fx=]]></rss>
+<rss name="Most Viewed"><![CDATA[http://www.grouper.com/rss/media.ashx?o=1&t=1&fx=]]></rss>
+<rss name="Most Discussed"><![CDATA[http://www.grouper.com/rss/media.ashx?o=4&t=1&fx=]]></rss>
+<rss name="Highest Rated"><![CDATA[http://www.grouper.com/rss/media.ashx?o=3&fx=]]></rss>
+<rss name="Most Viral"><![CDATA[http://www.grouper.com/rss/media.ashx?o=6&fx=]]></rss>
+</site>
+<!-- NOT WORKING CURRENTLY. Videos don't always play.
+<site>
+<name>Guba</name>
+<id>4</id>
+<rss name="Action"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=562&o=0&set=5]]></rss>
+<rss name="Animation"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=457&o=0&set=5]]></rss>
+<rss name="Classics"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=807&o=0&set=5]]></rss>
+<rss name="Comedy"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=456&o=0&set=5]]></rss>
+<rss name="Documentary"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=460&o=0&set=5]]></rss>
+<rss name="Drama"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=459&o=0&set=5]]></rss>
+<rss name="Educational"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=513&o=0&set=5]]></rss>
+<rss name="Family"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=514&o=0&set=5]]></rss>
+<rss name="Foreign"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=463&o=0&set=5]]></rss>
+<rss name="Independent"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=515&o=0&set=5]]></rss>
+<rss name="Miscellaneous"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=458&o=0&set=5]]></rss>
+<rss name="Music Videos"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=462&o=0&set=5]]></rss>
+<rss name="Romance"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=516&o=0&set=5]]></rss>
+<rss name="Sports"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=461&o=0&set=5]]></rss>
+<rss name="TV Shows"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=806&o=0&set=5]]></rss>
+<rss name="Thriller"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=517&o=0&set=5]]></rss>
+</site>
+-->
+<site>
+<name>MetaCafe</name>
+<id>5</id>
+<rss name="New Videos"><![CDATA[http://www.metacafe.com/rss/new_videos.rss]]></rss>
+</site>
+<site>
+<name>DailyMotion</name>
+<id>6</id>
+<rss name="Font Page"><![CDATA[http://www.dailymotion.com/rss]]></rss>
+<rss name="Ads"><![CDATA[http://www.dailymotion.com/rss/cluster/ads]]></rss>
+<rss name="Animals"><![CDATA[http://www.dailymotion.com/rss/cluster/animals]]></rss>
+<rss name="Fun"><![CDATA[http://www.dailymotion.com/rss/cluster/fun]]></rss>
+<rss name="Auto"><![CDATA[http://www.dailymotion.com/rss/cluster/auto]]></rss>
+<rss name="Street"><![CDATA[http://www.dailymotion.com/rss/cluster/street]]></rss>
+<rss name="Creation"><![CDATA[http://www.dailymotion.com/rss/cluster/creation]]></rss>
+<rss name="Short Films"><![CDATA[http://www.dailymotion.com/rss/cluster/shortfilms]]></rss>
+<rss name="Business"><![CDATA[http://www.dailymotion.com/rss/cluster/business]]></rss>
+<rss name="Tech"><![CDATA[http://www.dailymotion.com/rss/cluster/tech]]></rss>
+<rss name="Sport"><![CDATA[http://www.dailymotion.com/rss/cluster/sport]]></rss>
+<rss name="Extreme"><![CDATA[http://www.dailymotion.com/rss/cluster/extreme]]></rss>
+<rss name="Events"><![CDATA[http://www.dailymotion.com/rss/cluster/events]]></rss>
+<rss name="Family"><![CDATA[http://www.dailymotion.com/rss/cluster/family]]></rss>
+<rss name="Music"><![CDATA[http://www.dailymotion.com/rss/cluster/music]]></rss>
+<rss name="News"><![CDATA[http://www.dailymotion.com/rss/cluster/news]]></rss>
+<rss name="Parties"><![CDATA[http://www.dailymotion.com/rss/cluster/parties]]></rss>
+<rss name="School"><![CDATA[http://www.dailymotion.com/rss/cluster/school]]></rss>
+<rss name="Travel"><![CDATA[http://www.dailymotion.com/rss/cluster/travel]]></rss>
+<rss name="Video Games"><![CDATA[http://www.dailymotion.com/rss/cluster/videogames]]></rss>
+<rss name="Blog"><![CDATA[http://www.dailymotion.com/rss/cluster/blog]]></rss>
+<rss name="3D"><![CDATA[http://www.dailymotion.com/rss/cluster/3D]]></rss>
+<rss name="Dating"><![CDATA[http://www.dailymotion.com/rss/cluster/dating]]></rss>
+<rss name="Search"><![CDATA[http://www.dailymotion.com/rss/relevance/search/{0}]]></rss>
+</site>
+<!--
+<site>
+<name>ABC Online</name>
+<id>8</id>
+<rss name="videos" dynamic="yes"><![CDATA[http://ll.static.abc.com/streaming/s/catalog?aff=&isIE=true]]></rss>
+</site>
+-->
+<site>
+<name>BlipTV</name>
+<id>9</id>
+<rss name="videos"><![CDATA[http://blip.tv/?1=1&search=soccer;page=1;s=posts&skin=rss]]></rss>
+</site>
+<!--
+<site>
+<name>CBS Innertube</name>
+<id>10</id>
+<rss name="videos" dynamic="yes"><![CDATA[http://www.cbs.com/xml2/browseMenu/76.xml]]></rss>
+</site>
+-->
+<site>
+<name>GameTrailers</name>
+<id>11</id>
+<rss name="videos"><![CDATA[http://www.gametrailers.com/rss/newest.xml]]></rss>
+</site>
+<!--
+<site>
+<name>MSN SoapBox</name>
+<id>12</id>
+<rss name="videos"><![CDATA[http://soapbox.msn.com/rss.aspx?listId=mostpopular&categoryId=8118b646-92c6-4051-a1eb-40ef4ee49ec1]]></rss>
+</site>
+-->
+<site>
+<name>Video Jug</name>
+<id>13</id>
+<rss name="videos"><![CDATA[http://www.videojug.com/rss]]></rss>
+</site>
+<site>
+<name>VidiLife</name>
+<id>14</id>
+<rss name="videos"><![CDATA[http://rss.vidilife.com/rss.aspx]]></rss>
+</site>
+<site>
+<name>Apple Trailers</name>
+<id>15</id>
+<rss name="New Trailers"><![CDATA[http://www.apple.com/moviesxml/h/view1_all.xml]]></rss>
+<rss name="Action and Adventure"><![CDATA[http://movies.apple.com/moviesxml/g/action_and_adventure_1.xml]]></rss>
+<rss name="Comedy"><![CDATA[http://movies.apple.com/moviesxml/g/comedy_1.xml]]></rss>
+<rss name="Documentary"><![CDATA[http://movies.apple.com/moviesxml/g/documentary_1.xml]]></rss>
+<rss name="Drama"><![CDATA[http://movies.apple.com/moviesxml/g/drama_1.xml]]></rss>
+<rss name="Family"><![CDATA[http://movies.apple.com/moviesxml/g/family_1.xml]]></rss>
+<rss name="Foreign"><![CDATA[http://movies.apple.com/moviesxml/g/fantasy_1.xml]]></rss>
+<rss name="Horror"><![CDATA[http://movies.apple.com/moviesxml/g/horror_1.xml]]></rss>
+<rss name="Musical"><![CDATA[http://movies.apple.com/moviesxml/g/musical_1.xml]]></rss>
+<rss name="Romance"><![CDATA[http://movies.apple.com/moviesxml/g/romance_1.xml]]></rss>
+<rss name="Sience Fiction"><![CDATA[http://movies.apple.com/moviesxml/g/science_fiction_1.xml]]></rss>
+<rss name="Thriller"><![CDATA[http://movies.apple.com/moviesxml/g/thriller_1.xml]]></rss>
+<rss name="20th Century Fox"><![CDATA[http://movies.apple.com/moviesxml/s/fox/index_1.xml]]></rss>
+<rss name="DreamWorks S.K.G"><![CDATA[http://movies.apple.com/moviesxml/s/dreamworks/index_1.xml]]></rss>
+<rss name="Focus Features / Rogue Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/focus_features/index_1.xml]]></rss>
+<rss name="Fox Searchlight Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/fox_searchlight/index_1.xml]]></rss>
+<rss name="Independent"><![CDATA[http://movies.apple.com/moviesxml/s/independent/index_1.xml]]></rss>
+<rss name="Lionsgate"><![CDATA[http://movies.apple.com/moviesxml/s/lions_gate/index_1.xml]]></rss>
+<rss name="MGM Studios"><![CDATA[http://movies.apple.com/moviesxml/s/mgm/index_1.xml]]></rss>
+<rss name="Magnolia Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/magnolia/index_1.xml]]></rss>
+<rss name="Miramax Films"><![CDATA[http://movies.apple.com/moviesxml/s/miramax/index_1.xml]]></rss>
+<rss name="New Line Cinema"><![CDATA[http://movies.apple.com/moviesxml/s/newline/index_1.xml]]></rss>
+<rss name="Paramount Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/paramount/index_1.xml]]></rss>
+<rss name="Paramount Vantage"><![CDATA[http://movies.apple.com/moviesxml/s/paramount_vantage/index_1.xml]]></rss>
+<rss name="Picturehouse"><![CDATA[http://movies.apple.com/moviesxml/s/picturehouse/index_1.xml]]></rss>
+<rss name="Rogue Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/rogue_pictures/index_1.xml]]></rss>
+<rss name="Sony Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/sony_pictures/index_1.xml]]></rss>
+<rss name="Sony Pictures Classics"><![CDATA[http://movies.apple.com/moviesxml/s/sony/index_1.xml]]></rss>
+<rss name="Touchstone Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/touchstone/index_1.xml]]></rss>
+<rss name="Universal Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/universal/index_1.xml]]></rss>
+<rss name="Walt Disney Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/disney/index_1.xml]]></rss>
+<rss name="Warner Bros. Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/wb/index_1.xml]]></rss>
+<rss name="Warner Independent Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/warner_independent_pictures/index_1.xml]]></rss>
+<rss name="Weinstein"><![CDATA[http://movies.apple.com/moviesxml/s/weinstein/index_1.xml]]></rss>
+</site>
+<site>
+<id>99</id>
+<name>Downloaded Videos</name>
+<rss name="Downloads"><![CDATA[C:\FlashVideos\]]></rss>
+</site>
+</sites>
+</settings>
\ No newline at end of file
Added: trunk/plugins/Skin/BlueTwo/myonlinevideos.xml
===================================================================
--- trunk/plugins/Skin/BlueTwo/myonlinevideos.xml (rev 0)
+++ trunk/plugins/Skin/BlueTwo/myonlinevideos.xml 2007-04-14 00:36:06 UTC (rev 318)
@@ -0,0 +1,22 @@
+<window>
+ <id>4755</id>
+ <defaultcontrol>50</defaultcontrol>
+ <allowoverlay>yes</allowoverlay>
+ <define>#header.label:MyOnlineVideos</define>
+ <controls>
+ <import>common.window.xml</import>
+ <import>common.facade.xml</import>
+ <control>
+ <type>button</type>
+ <description>View button</description>
+ <id>2</id>
+ <posX>60</posX>
+ <posY>97</posY>
+ <onleft>4</onleft>
+ <onright>50</onright>
+ <onup>3</onup>
+ <ondown>2</ondown>
+ <label>101</label>
+ </control>
+ </controls>
+</window>
\ No newline at end of file
Added: trunk/plugins/Source/AbcUtil.cs
===================================================================
--- trunk/plugins/Source/AbcUtil.cs (rev 0)
+++ trunk/plugins/Source/AbcUtil.cs 2007-04-14 00:36:06 UTC (rev 318)
@@ -0,0 +1,131 @@
+using System;
+using MediaPortal.GUI.Library;
+using System.Text.RegularExpressions;
+using System.Net;
+using System.Text;
+using MediaPortal.Player;
+using System.Collections.Generic;
+//using MediaPortal.Utils.Services;
+using MediaPortal.GUI.View ;
+using MediaPortal.Dialogs;
+using System.Xml;
+using System.Xml.XPath;
+using System.ComponentModel;
+using System.Threading;
+
+
+
+namespace OnlineVideos
+{
+ public class AbcUtil:SiteUtilBase
+ {
+ //private String msXmlLink;
+ public override List<GUIOnlineVideos.VideoInfo> getSiteFavorites()
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
+ public override bool isSiteFavoritesEnabled()
+ {
+ return false;
+ }
+
+ public override String getUrl(String fsId)
+ {
+
+ return fsId ;
+ }
+
+ public override List<GUIOnlineVideos.VideoInfo> getVideoList(string fsUrl)
+ {
+ List<RssItem> loRssItemList = getRssDataItems(fsUrl);
+ List<GUIOnlineVideos.VideoInfo> loVideoList = new List<GUIOnlineVideos.VideoInfo>();
+ GUIOnlineVideos.VideoInfo video;
+ foreach(RssItem rssItem in loRssItemList){
+ video = new GUIOnlineVideos.VideoInfo();
+ video.Description = rssItem.mediaDescription;
+ video.ImageUrl = rssItem.mediaThumbnail;
+ video.Title = rssItem.title;
+ foreach(MediaContent content in rssItem.contentList){
+ if(content.type.Contains("flv")){
+ video.VideoUrl = content.url;
+ break;
+ }
+ }
+ loVideoList.Add(video);
+ }
+ return loVideoList;
+ }
+ /*
+ public List<GUIOnlineVideos.VideoInfo> getRssData(String fsUrl)
+ {
+
+
+ XmlDocument doc = new XmlDocument();
+ //XPathDocument doc = new XPathDocument(fsUrl);
+
+ doc.Load(XmlReader.Create("http://ll.static.abc.com/streaming/s/catalog?aff=&isIE=true"));
+ XmlNamespaceManager expr = new XmlNamespaceManager(doc.NameTable);
+ expr.AddNamespace("media", "http://search.yahoo.com/mrss");
+ XmlNode StreamServerNode = doc.SelectSingleNode("//config/streamServer");
+ String lsStreamServer = "RTMP://"+StreamServerNode.InnerText;
+ Console.WriteLine("Stream Server ={0} ",lsStreamServer);
+
+ //Create the root XmlNode and generate an XmlNodeList from it.
+ XmlNode root = doc.SelectSingleNode("//streaming/catalog/channel", expr);
+ XmlNodeList nodeList;
+ nodeList = root.SelectNodes("//streaming/catalog/channel[title='Six Degrees']/episode");
+ //Console.WriteLine(nodeList.Count);
+
+
+ //RssItem loRssItem = new RssItem();
+ //loRssItem.
+ //This loops through each node found in the nodeList and adds the
+ //Node data to the DataTable.
+ //XmlAttributeCollection ac;
+ List<GUIOnlineVideos.VideoInfo> loRssItems = new List<GUIOnlineVideos.VideoInfo>();
+ GUIOnlineVideos.VideoInfo loRssItem;
+ //GUIListItem loListItem;
+ foreach (XmlNode chileNode in nodeList)
+ {
+ loRssItem = new GUIOnlineVideos.VideoInfo();
+
+ XmlNode node = chileNode.SelectSingleNode("title");
+ loRssItem.Title = node.InnerText;
+
+ //node = chileNode.SelectSingleNode("link");
+ //loRssItem.link = node.InnerText;
+
+ node = chileNode.SelectSingleNode("description");
+ loRssItem.Description = node.InnerText;
+
+ node = chileNode.SelectSingleNode("screenShot", expr);
+ if (node != null)
+ {
+ //ac = node.Attributes;
+ loRssItem.ImageUrl = node.InnerText;
+ }
+
+
+ XmlNodeList SegNodeList = chileNode.SelectNodes("segment/HighStreamURL", expr);
+ loRssItem.VideoUrl = "";
+ foreach(XmlNode SegNode in SegNodeList )
+ {
+ //ac = node.Attributes;
+ loRssItem.VideoUrl = loRssItem.VideoUrl+lsStreamServer+SegNode.InnerText+",";
+ }
+ //Console.WriteLine(loRssItem.VideoUrl.ToString());
+
+ //Log.Write(loRssItem.ToString());
+ //loListItem = new GUIListItem(loRssItem.title);
+ //loListItem.Path = loRssItem.videoUrl;
+ loRssItems.Add(loRssItem);
+
+
+ }
+ return loRssItems;
+ }
+
+ */
+
+ }
+}
Added: trunk/plugins/Source/AssemblyInfo.cs
===================================================================
--- trunk/plugins/Source/AssemblyInfo.cs (rev 0)
+++ trunk/plugins/Source/AssemblyInfo.cs 2007-04-14 00:36:06 UTC (rev 318)
@@ -0,0 +1,31 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// Information about this assembly is defined by the following
+// attributes.
+//
+// change them to the information which is associated with the assembly
+// you compile.
+
+[assembly: AssemblyTitle("Runner")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Runner")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// This sets the default COM visibility of types in the assembly to invisible.
+// If you need to expose a type to COM, use [ComVisible(true)] on that type.
+[assembly: ComVisible(false)]
+
+// The assembly version has following format :
+//
+// Major.Minor.Build.Revision
+//
+// You can specify all values by your own or you can build default build and revision
+// numbers with the '*' character (the default):
+
+[assembly: AssemblyVersion("1.0.*")]
Added: trunk/plugins/Source/BlipTvUtil.cs
===================================================================
--- trunk/plugins/Source/BlipTvUtil.cs (rev 0)
+++ trunk/plugins/Source/BlipTvUtil.cs 2007-04-14 00:36:06 UTC (rev 318)
@@ -0,0 +1,115 @@
+using System;
+using MediaPortal.GUI.Library;
+using System.Text.RegularExpressions;
+using System.Net;
+using System.Text;
+using MediaPortal.Player;
+using System.Collections.Generic;
+//using MediaPortal.Utils.Services;
+using MediaPortal.GUI.View ;
+using MediaPortal.Dialogs;
+using System.Xml;
+using System.Xml.XPath;
+using System.ComponentModel;
+using System.Threading;
+
+
+
+namespace OnlineVideos
+{
+ public class BlipTvUtil:SiteUtilBase
+ {
+
+
+ public override String getUrl(String fsId)
+ {
+
+ return fsId + "&txe=.flv";
+ }
+
+ public override List<GUIOnlineVideos.VideoInfo> getVideoList(string fsUrl)
+ {
+ List<RssItem> loRssItemList = getRssDataItems(fsUrl);
+ List<GUIOnlineVideos.VideoInfo> loVideoList = new List<GUIOnlineVideos.VideoInfo>();
+ GUIOnlineVideos.VideoInfo video;
+ foreach(RssItem rssItem in loRssItemList){
+ video = new GUIOnlineVideos.VideoInfo();
+ video.Description = rssItem.mediaDescription;
+ video.ImageUrl = rssItem.mediaThumbnail;
+ video.Title = rssItem.title;
+ foreach(MediaContent content in rssItem.contentList){
+ if(content.type.Contains("flv")){
+ video.VideoUrl = content.url;
+ break;
+ }
+ }
+ loVideoList.Add(video);
+ }
+ return loVideoList;
+ }
+ public List<GUIOnlineVideos.VideoInfo> getRssData(String fsUrl)
+ {
+
+ XmlDocument doc = new XmlDocument();
+ //XPathDocument doc = new XPathDocument(fsUrl);
+
+ doc.Load(XmlReader.Create(fsUrl));
+ XmlNamespaceManager expr = new XmlNamespaceManager(doc.NameTable);
+ expr.AddNamespace("media", "http://search.yahoo.com/mrss");
+
+ //Create the root XmlNode and generate an XmlNodeList from it.
+ XmlNode root = doc.SelectSingleNode("//rss/channel/item", expr);
+ XmlNodeList nodeList;
+ nodeList = root.SelectNodes("//rss/channel/item");
+ //RssItem loRssItem = new RssItem();
+ //loRssItem.
+ //This loops through each node found in the nodeList and adds the
+ //Node data to the DataTable.
+ XmlAttributeCollection ac;
+ List<GUIOnlineVideos.VideoInfo> loRssItems = new List<GUIOnlineVideos.VideoInfo>();
+ GUIOnlineVideos.VideoInfo loRssItem;
+ //GUIListItem loListItem;
+ foreach (XmlNode chileNode in nodeList)
+ {
+ loRssItem = new GUIOnlineVideos.VideoInfo();
+
+ XmlNode node = chileNode.SelectSingleNode("title");
+ loRssItem.Title = node.InnerText;
+
+ //node = chileNode.SelectSingleNode("link");
+ //loRssItem.link = node.InnerText;
+
+ node = chileNode.SelectSingleNode("description");
+ loRssItem.Description = node.InnerText;
+
+ node = chileNode.SelectSingleNode("media:thumbnail", expr);
+ if (node != null)
+ {
+ ac = node.Attributes;
+ loRssItem.ImageUrl = ac["url"].InnerText;
+ }
+
+
+ node = chileNode.SelectSingleNode("media:group/media:content[@type=\"video/x-flv\"]", expr);
+ if (node != null)
+ {
+ ac = node.Attributes;
+ loRssItem.VideoUrl = ac["url"].InnerText;
+ }
+
+ //Log.Write(loRssItem.ToString());
+ //loListItem = new GUIListItem(loRssItem.title);
+ //loListItem.Path = loRssItem.videoUrl;
+ loRssItems.Add(loRssItem);
+
+
+ }
+ return loRssItems;
+ }
+
+
+
+
+
+ }
+}
Added: trunk/plugins/Source/BreakUtil.cs
===================================================================
--- trunk/plugins/Source/BreakUtil.cs (rev 0)
+++ trunk/plugins/Source/BreakUtil.cs 2007-04-14 00:36:06 UTC (rev 318)
@@ -0,0 +1,115 @@
+using System;
+using MediaPortal.GUI.Library;
+using System.Text.RegularExpressions;
+using System.Net;
+using System.Text;
+using MediaPortal.Player;
+using System.Collections.Generic;
+//using MediaPortal.Utils.Services;
+using MediaPortal.GUI.View ;
+using MediaPortal.Dialogs;
+using System.Xml;
+using System.Xml.XPath;
+using System.ComponentModel;
+using System.Threading;
+
+
+
+namespace OnlineVideos
+{
+ public class BreakUtil:SiteUtilBase
+ {
+
+ public override String getUrl(String fsId)
+ {
+ String lsHtml = getHTMLData(fsId);
+ //Log.Write("html to parse to get url = \n{0}",lsHtml);
+ Regex loPathRegex = new Regex("sGlobalFileName='([^']*)';[^;]*;sGlobalContentFilePath='([^']*)'");
+ Regex loUrlRegex = new Regex("so.addVariable\\('sVidLoc', '([^']*)");
+
+ String lsUrl = loUrlRegex.Match(lsHtml).Groups[1].Value;
+ Match loMatch = loPathRegex.Match(lsHtml);
+ String lsFileName = loMatch.Groups[1].Value;
+ String lsPathName = loMatch.Groups[2].Value;
+ lsUrl = lsUrl+lsPathName+"/"+lsFileName+".flv";
+ Log.Write("break flv url = {0}",lsUrl);
+ return lsUrl;
+ }
+ public override List<GUIOnlineVideos.VideoInfo> getVideoList(string fsUrl)
+ {
+ List<RssItem> loRssItemList = getRssDataItems(fsUrl);
+ List<GUIOnlineVideos.VideoInfo> loVideoList = new List<GUIOnlineVideos.VideoInfo>();
+ GUIOnlineVideos.VideoInfo video;
+ foreach(RssItem rssItem in loRssItemList){
+ video = new GUIOnlineVideos.VideoInfo();
+ video.Description = rssItem.description;
+ video.ImageUrl = rssItem.enclosure;
+ video.Title = rssItem.title;
+ //foreach(MediaContent content in rssItem.contentList){
+ // if(content.type.Contains("flv")){
+ video.VideoUrl = rssItem.link;
+ // break;
+ // }
+ loVideoList.Add(video);
+ }
+ return loVideoList;
+ }
+ /*
+ public List<GUIOnlineVideos.VideoInfo> getRssData(String fsUrl)
+ {
+
+ XmlDocument doc = new XmlDocument();
+ //XPathDocument doc = new XPathDocument(fsUrl);
+
+ doc.Load(XmlReader.Create(fsUrl));
+ //XmlNamespaceManager expr = new XmlNamespaceManager(doc.NameTable);
+ //expr.AddNamespace("", "http://search.yahoo.com/mrss");
+ //Console.WriteLine(doc.InnerXml);
+ //Create the root XmlNode and generate an XmlNodeList from it.
+ XmlNode root = doc.SelectSingleNode("//rss/channel/item");
+ if(root==null){
+ Console.WriteLine(root);
+
+ }
+ XmlNodeList nodeList;
+ nodeList = root.SelectNodes("//rss/channel/item");
+ //RssItem loRssItem = new RssItem();
+ //loRssItem.
+ //This loops through each node found in the nodeList and adds the
+ //Node data to the DataTable.
+ XmlAttributeCollection ac;
+ List<GUIOnlineVideos.VideoInfo> loRssItems = new List<GUIOnlineVideos.VideoInfo>();
+ GUIOnlineVideos.VideoInfo loRssItem;
+ //GUIListItem loListItem;
+ foreach (XmlNode chileNode in nodeList)
+ {
+ loRssItem = new GUIOnlineVideos.VideoInfo();
+
+ XmlNode node = chileNode.SelectSingleNode("title");
+ loRssItem.Title = node.InnerText;
+
+ node = chileNode.SelectSingleNode("link");
+ loRssItem.VideoUrl = node.InnerText;
+
+ node = chileNode.SelectSingleNode("description");
+ loRssItem.Description = node.InnerText;
+
+ node = chileNode.SelectSingleNode("enclosure");
+ if (node != null)
+ {
+ ac = node.Attributes;
+ loRssItem.ImageUrl = ac["url"].InnerText;
+ }
+ loRssItems.Add(loRssItem);
+
+
+ }
+
+ return loRssItems;
+ }
+ */
+
+
+
+ }
+}
Added: trunk/plugins/Source/CbsUtil.cs
===================================================================
--- trunk/plugins/Source/CbsUtil.cs (rev 0)
+++ trunk/plugins/Source/CbsUtil.cs 2007-04-14 00:36:06 UTC (rev 318)
@@ -0,0 +1,125 @@
+using System;
+using MediaPortal.GUI.Library;
+using System.Text.RegularExpressions;
+using System.Net;
+using System.Text;
+using MediaPortal.Player;
+using System.Collections.Generic;
+//using MediaPortal.Utils.Services;
+using MediaPortal.GUI.View ;
+using MediaPortal.Dialogs;
+using System.Xml;
+using System.Xml.XPath;
+using System.ComponentModel;
+using System.Threading;
+
+
+
+namespace OnlineVideos
+{
+ public class CbsUtil:SiteUtilBase
+ {
+
+
+
+ public override String getUrl(String fsId)
+ {
+ return "http://video.cgi.cbs.com/vplayer3/play.pl?id="+fsId;
+
+ }
+ public override List<GUIOnlineVideos.VideoInfo> getVideoList(string fsUrl)
+ {
+ return getRssData(fsUrl);
+ }
+ public List<GUIOnlineVideos.VideoInfo> getRssData(String fsUrl)
+ {
+
+ XmlDocument doc = new XmlDocument();
+ //XPathDocument doc = new XPathDocument(fsUrl);
+
+ doc.Load(XmlReader.Create("http://www.cbs.com/innertube/xmlProxy.php?type=videoList&id="+fsUrl));
+ XmlNamespaceManager expr = new XmlNamespaceManager(doc.NameTable);
+ expr.AddNamespace("media", "http://search.yahoo.com/mrss");
+
+ //Create the root XmlNode and generate an XmlNodeList from it.
+ XmlNode root = doc.SelectSingleNode("//videoList/list/video", expr);
+ XmlNodeList nodeList;
+ nodeList = root.SelectNodes("//videoList/list/video");
+ //RssItem loRssItem = new RssItem();
+ //loRssItem.
+ //This loops through each node found in the nodeList and adds the
+ //Node data to the DataTable.
+ XmlAttributeCollection ac;
+ List<GUIOnlineVideos.VideoInfo> loRssItems = new List<GUIOnlineVideos.VideoInfo>();
+ GUIOnlineVideos.VideoInfo loRssItem;
+ //GUIListItem loListItem;
+ foreach (XmlNode childNode in nodeList)
+ {
+ loRssItem = new GUIOnlineVideos.VideoInfo();
+ ac = childNode.Attributes;
+
+ //XmlNode node = chileNode.SelectSingleNode("title");
+ loRssItem.Title = ac["show"].InnerText;
+ loRssItem.Description = ac["summary"].InnerText;
+ loRssItem.ImageUrl = "http://www.cbs.com"+ac["image"].InnerText;
+ loRssItem.VideoUrl = ac["videoID"].InnerText;
+
+
+ //Log.Write(loRssItem.ToString());
+ //loListItem = new GUIListItem(loRssItem.title);
+ //loListItem.Path = loRssItem.videoUrl;
+ loRssItems.Add(loRssItem);
+
+
+ }
+ return loRssItems;
+ }
+ public List<GUIOnlineVideos.VideoInfo> getCategories(String fsUrl)
+ {
+
+ XmlDocument doc = new XmlDocument();
+ //XPathDocument doc = new XPathDocument(fsUrl);
+
+ doc.Load(XmlReader.Create(fsUrl));
+ XmlNamespaceManager expr = new XmlNamespaceManager(doc.NameTable);
+ expr.AddNamespace("media", "http://search.yahoo.com/mrss");
+
+ //Create the root XmlNode and generate an XmlNodeList from it.
+ XmlNode root = doc.SelectSingleNode("//browseMenu/primary/secondary", expr);
+ XmlNodeList nodeList;
+ nodeList = root.SelectNodes("//browseMenu/primary/secondary");
+ //RssItem loRssItem = new RssItem();
+ //loRssItem.
+ //This loops through each node found in the nodeList and adds the
+ //Node data to the DataTable.
+ XmlAttributeCollection ac;
+ List<GUIOnlineVideos.VideoInfo> loRssItems = new List<GUIOnlineVideos.VideoInfo>();
+ GUIOnlineVideos.VideoInfo loRssItem;
+ //GUIListItem loListItem;
+ foreach (XmlNode chileNode in nodeList)
+ {
+ loRssItem = new GUIOnlineVideos.VideoInfo();
+
+ XmlNode node = chileNode.SelectSingleNode("name");
+ loRssItem.Title = node.InnerText;
+
+ //node = chileNode.SelectSingleNode("link");
+ //loRssItem.link = node.InnerText;
+
+ node = chileNode.SelectSingleNode("id");
+ loRssItem.VideoUrl = node.InnerText;
+
+ //node = chileNode.SelectSingleNode("media:group/media:thumbnail", expr);
+ //get the description and images for the categories
+
+
+ loRssItems.Add(loRssItem);
+
+
+ }
+ return loRssItems;
+ }
+
+
+ }
+}
Added: trunk/plugins/Source/DailyMotionUtil.cs
===================================================================
--- trunk/plugins/Source/DailyMotionUtil.cs (rev 0)
+++ trunk/plugins/Source/DailyMotionUtil.cs 2007-04-14 00:36:06 UTC (rev 318)
@@ -0,0 +1,112 @@
+using System;
+using MediaPortal.GUI.Library;
+using System.Text.RegularExpressions;
+using System.Net;
+using System.Text;
+using MediaPortal.Player;
+using System.Collections.Generic;
+//using MediaPortal.Utils.Services;
+using MediaPortal.GUI.View ;
+using MediaPortal.Dialogs;
+using System.Xml;
+using System.Xml.XPath;
+using System.ComponentModel;
+using System.Threading;
+
+
+
+namespace OnlineVideos
+{
+ public class DailyMotionUtil:SiteUtilBase
+ {
+
+
+ public override String getUrl(String fsId)
+ {
+
+ return fsId;
+ }
+ public override List<GUIOnlineVideos.VideoInfo> getVideoList(string fsUrl)
+ {
+ List<RssItem> loRssItemList = getRssDataItems(fsUrl);
+ List<GUIOnlineVideos.VideoInfo> loVideoList = new List<GUIOnlineVideos.VideoInfo>();
+ GUIOnlineVideos.VideoInfo video;
+ foreach(RssItem rssItem in loRssItemList){
+ video = new GUIOnlineVideos.VideoInfo();
+ video.Description = rssItem.description;
+ video.ImageUrl = rssItem.mediaThumbnail;
+ video.Title = rssItem.title;
+ foreach(MediaContent content in rssItem.contentList){
+ if(content.type.Contains("flv")){
+ video.VideoUrl = content.url;
+ break;
+ }
+ }
+ loVideoList.Add(video);
+ }
+ return loVideoList;
+ }
+ public List<GUIOnlineVideos.VideoInfo> getRssData(String fsUrl)
+ {
+
+ XmlDocument doc = new XmlDocument();
+
+ doc.Load(XmlReader.Create(fsUrl));
+ XmlNamespaceManager expr = new XmlNamespaceManager(doc.NameTable);
+ expr.AddNamespace("media", "http://search.yahoo.com/mrss");
+
+ //Create the root XmlNode and generate an XmlNodeList from it.
+ XmlNode root = doc.SelectSingleNode("//rss/channel/item", expr);
+ XmlNodeList nodeList;
+ nodeList = root.SelectNodes("//rss/channel/item");
+
+ XmlAttributeCollection ac;
+ List<GUIOnlineVideos.VideoInfo> loRssItems = new List<GUIOnlineVideos.VideoInfo>();
+ //RssItem loRssItem;
+ //GUIListItem loListItem;
+ GUIOnlineVideos.VideoInfo loVideoInfo;
+ foreach (XmlNode chileNode in nodeList)
+ {
+ //loRssItem = new RssItem();
+ loVideoInfo = new GUIOnlineVideos.VideoInfo();
+ XmlNode node = chileNode.SelectSingleNode("title");
+ //loRssItem.title = node.InnerText;
+ loVideoInfo.Title = node.InnerText;
+
+ //node = chileNode.SelectSingleNode("link");
+ //loRssItem.link = node.InnerText;
+
+
+ node = chileNode.SelectSingleNode("description");
+ //loRssItem.description = node.InnerText;
+ loVideoInfo.Description = node.InnerText;
+
+ node = chileNode.SelectSingleNode("media:thumbnail", expr);
+ if (node != null)
+ {
+ ac = node.Attributes;
+ //loRssItem.imageUrl = ac["url"].InnerText;
+ loVideoInfo.ImageUrl = ac["url"].InnerText;
+ }
+
+
+ node = chileNode.SelectSingleNode("media:group/media:content[@type=\"video/x-flv\"]", expr);
+ if (node != null)
+ {
+ ac = node.Attributes;
+ //loRssItem.videoUrl = ac["url"].InnerText;
+ loVideoInfo.VideoUrl = ac["url"].InnerText;
+
+ }
+
+ //Log.Write(loRssItem.ToString());
+ //loListItem = new GUIListItem(loRssItem.title);
+ //loListItem.Path = loRssItem.videoUrl;
+ loRssItems.Add(loVideoInfo);
+
+
+ }
+ return loRssItems;
+ }
+ }
+}
Added: trunk/plugins/Source/DownloadedVideoUtil.cs
===================================================================
--- trunk/plugins/Source/DownloadedVideoUtil.cs (rev 0)
+++ trunk/plugins/Source/DownloadedVideoUtil.cs 2007-04-14 00:36:06 UTC (rev 318)
@@ -0,0 +1,48 @@
+using System;
+using MediaPortal.GUI.Library;
+using System.Text.RegularExpressions;
+using System.IO;
+using System.Text;
+using MediaPortal.Player;
+using System.Collections.Generic;
+//using MediaPortal.Utils.Services;
+using MediaPortal.GUI.View ;
+using MediaPortal.Dialogs;
+using MediaPortal.Util;
+using System.Xml;
+using System.Xml.XPath;
+using System.ComponentModel;
+using System.Threading;
+
+
+
+namespace OnlineVideos
+{
+ public class DownloadedVideoUtil:SiteUtilBase
+ {
+
+
+ public override String getUrl(String fsId)
+ {
+
+ return fsId;
+ }
+ public override List<GUIOnlineVideos.VideoInfo> getVideoList(string fsUrl)
+ {
+ List<GUIOnlineVideos.VideoInfo>loVideoInfoList = new List<GUIOnlineVideos.VideoInfo>();
+ string[]loVideoList = Directory.GetFiles(fsUrl,"*.flv");
+
+ GUIOnlineVideos.VideoInfo loVideoInfo;
+ foreach (String lsVideo in loVideoList)
+ {
+ loVideoInfo = new GUIOnlineVideos.VideoInfo();
+ loVideoInfo.VideoUrl = lsVideo;
+
+ loVideoInfo.Title = Utils.GetFilename(lsVideo);
+ loVideoInfoList.Add(loVideoInfo);
+ }
+ return loVideoInfoList;
+ }
+
+ }
+}
Added: trunk/plugins/Source/FlashVideoScreen.cs
===================================================================
--- trunk/plugins/Source/FlashVideoScreen.cs (rev 0)
+++ trunk/plugins/Source/FlashVideoScreen.cs 2007-04-14 00:36:06 UTC (rev 318)
@@ -0,0 +1,303 @@
+using System;
+using MediaPortal.GUI.Library;
+using System.Text.RegularExpressions;
+using System.Net;
+using System.Text;
+using MediaPortal.Player;
+using MediaPortal.Playlists;
+using System.Collections.Generic;
+//using MediaPortal.Utils.Services;
+using MediaPortal.GUI.View;
+using MediaPortal.Dialogs;
+using System.Xml;
+using System.Xml.XPath;
+using System.ComponentModel;
+using System.Threading;
+
+
+
+namespace GoogleVideos
+{
+ public class FlashVideoScreen : GUIWindow
+ {
+
+ [SkinControlAttribute(2)]
+ protected GUIButtonControl btnBack = null;
+ [SkinControlAttribute(3)]
+ protected GUIButtonControl btnPlay = null;
+ [SkinControlAttribute(4)]
+ protected GUIButtonControl btnPause = null;
+ [SkinControlAttribute(5)]
+ protected GUIButtonControl btnStop = null;
+ [SkinControlAttribute(6)]
+ protected GUIButtonControl btnForward = null;
+ [SkinControlAttribute(7)]
+ protected GUIButtonControl btnBackward = null;
+
+ [SkinControlAttribute(20)]
+ protected GUIProgressControl progress = null;
+
+ //private Log moLog;
+ private String _CurrentFile = String.Empty;
+ private String _CurrentDescription = String.Empty;
+ //private List<OnlineVideo> moVideoList = new List<OnlineVideo>();
+
+
+ public FlashVideoScreen()
+ {
+ //ServiceProvider loServices = GlobalServiceProvider.Instance;
+ //moLog = loServices.Get<ILog>();
+ }
+ /*
+ public string PluginName()
+ {
+
+ return "GoogleVideo";
+
+ }
+
+ // Returns the description of the plugin is shown in the plugin menu
+
+ public string Description()
+ {
+
+ return "Google Video Plugin";
+
+ }
+
+ // Returns the author of the plugin which is shown in the plugin menu
+
+ public string Author()
+ {
+
+ return "GregMac45";
+
+ }
+
+ // show the setup dialog
+
+ public void ShowPlugin()
+ {
+
+ //MessageBox.Show("Nothing to configure, this is just an example");
+
+ }
+
+ // Indicates whether plugin can be enabled/disabled
+
+ public bool CanEnable()
+ {
+
+ return true;
+
+ }
+ * */
+
+ // get ID of windowplugin belonging to this setup
+
+ public int GetWindowId()
+ {
+
+ return GetID;
+
+ }
+
+ // Indicates if plugin is enabled by default;
+
+ public bool DefaultEnabled()
+ {
+
+ return true;
+
+ }
+
+ // indicates if a plugin has its own setup screen
+
+ //public bool HasSetup()
+ //{
+
+ // return false;
+
+ //}
+ public override int GetID
+ {
+
+ get
+ {
+
+ return 4760;
+
+ }
+
+ set
+ {
+
+ }
+
+ }
+
+ public override bool Init()
+ {
+
+ return Load(GUIGraphicsContext.Skin + @"\flashvideoscreen.xml");
+
+ }
+ /*
+ public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage)
+ {
+
+ strButtonText = PluginName();
+
+ strButtonImage = String.Empty;
+
+ strButtonImageFocus = String.Empty;
+
+ strPictureImage = String.Empty;
+
+ return true;
+
+ }
+ * */
+ protected override void OnPageLoad()
+ {
+ base.OnPageLoad();
+ //if(g_Player.Playing){
+ // _CurrentFile = g_Player.CurrentFile;
+ // }
+ }
+ protected override void OnPreviousWindow()
+ {
+ g_Player.Stop();
+ base.OnPreviousWindow();
+ }
+ public override bool OnMessage(GUIMessage message)
+ {
+
+ if (message.Message == GUIMessage.MessageType.GUI_MSG_PLAYBACK_STARTED)
+ {
+ bool lbPlayFullscreen = false;
+ //_log.Info("Playback message received from sender:{0}", message.SenderControlId);
+ if (message.SenderControlId == 4750)
+ {
+ if(message.Object!=null){
+ String [] loParms = (String []) message.Object;
+ if(loParms[0].Equals("1")){
+ lbPlayFullscreen = true;
+ }
+ Log.Info("object:{0}",message.Object);
+ }
+
+ //label = source
+ //label2 = title
+ //label3= description
+ //label4 = link
+ //_log.Info("label = {0}", message.Label);
+ _CurrentFile = message.Label4;
+ //if (_CurrentFile.EndsWith(".flv") == false)
+ //{
+
+ //}
+ //_log.Info("label2 = {0}", message.Label2);
+ _CurrentDescription = message.Label3;
+
+ GUIPropertyManager.SetProperty("#TV.View.description", _CurrentDescription);
+ GUIPropertyManager.SetProperty("#TV.View.title", message.Label2);
+ //GUIPropertyManager.SetProperty("#TV.View.channel", message.Label);
+ if(_CurrentFile.IndexOf(',')>0){
+ PlayListPlayer loPlayer = PlayListPlayer.SingletonPlayer;
+ char[] seps = { ',' };
+ String[] values = _CurrentFile.Split(seps);
+ //_CurrentFile.Split(seps);
+
+ PlayList loPlayList = loPlayer.GetPlaylist(PlayListType.PLAYLIST_VIDEO);
+ foreach(String url in values){
+ loPlayList.Add(new PlayListItem("",url));
+ }
+ loPlayer.CurrentPlaylistType = PlayListType.PLAYLIST_VIDEO;
+ loPlayer.Play(0);
+ }else{
+ g_Player.Play(_CurrentFile);
+ }
+ if(lbPlayFullscreen){
+ GUIGraphicsContext.IsFullScreenVideo = true;
+ GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO);
+ }
+ //g_Player.StepNow();
+ //g_Player.StepNow();
+ //g_Player.StepNow();
+ }
+ }
+ return base.OnMessage(message);
+ }
+ protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
+ {
+ base.OnClicked(controlId, control, actionType);
+
+
+ if (control == btnBack)
+ {
+ g_Player.Stop();
+ GUIWindowManager.ShowPreviousWindow();
+ }
+ else if (control == btnPause)
+ {
+ g_Player.Pause();
+ }
+ else if (control == btnStop)
+ {
+ g_Player.Stop();
+ }
+ else if (control == btnForward)
+ {
+ g_Player.SeekRelativePercentage(10);
+ }
+ else if (control == btnBackward)
+ {
+ g_Player.SeekRelativePercentage(-10);
+ }
+ else if (control == btnPlay)
+ {
+ if (_CurrentFile != String.Empty)
+ {
+ if (g_Player.Paused)
+ {
+ g_Player.Pause();
+ }
+ if (g_Player.Playing == false)
+ {
+ if(_CurrentFile.IndexOf(",")>0){
+ PlayListPlayer.SingletonPlayer.Play(0);
+ }else{
+ g_Player.Play(_CurrentFile);
+ }
+
+ }
+
+ }
+ }
+
+ }
+ public override void Process()
+ {
+ if (g_Player.Playing)
+ {
+ //_log.Info("Screen requesting current duration");
+ double iTotalSecs = g_Player.Duration;
+ //_log.Info("Screen received duration:{0}", iTotalSecs);
+ if (iTotalSecs > 0)
+ {
+ //_log.Info("Screen requesting current position");
+ double iCurSecs = g_Player.CurrentPosition;
+ //_log.Info("Screen received position:{0}", iCurSecs);
+ double fPercent = ((double)iCurSecs) / ((double)iTotalSecs);
+ fPercent *= 100.0d;
+ //_log.Info("progress percent:{0}", fPercent);
+
+ GUIPropertyManager.SetProperty("#TV.View.Percentage", ((int)fPercent).ToString());
+ //_log.Info("progress percent:{0}", GUIPropertyManager.GetProperty("#TV.View.Percentage"));
+ }
+ }
+ base.Process();
+ }
+ }
+}
Added: trunk/plugins/Source/GUIOnlineVideos.cs
===================================================================
--- trunk/plugins/Source/GUIOnlineVideos.cs (rev 0)
+++ trunk/plugins/Source/GUIOnlineVideos.cs 2007-04-14 00:36:06 UTC (rev 318)
@@ -0,0 +1,721 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.Xml.XPath;
+using System.ComponentModel;
+using System.Net;
+using System.Web;
+using System.IO;
+using System.Text.RegularExpressions;
+using MediaPortal.GUI.Library;
+using MediaPortal.Dialogs;
+//using MediaPortal.Utils.Services;
+using MediaPortal.Utils;
+using MediaPortal.Player;
+
+namespace OnlineVideos
+{
+ public class GUIOnlineVideos : GUIWindow, ISetupForm
+ {
+ [SkinControlAttribute(2)]
+ protected GUIButtonControl btnViewAs = null;
+ [SkinControlAttribute(50)]
+ protected GUIFacadeControl facadeView = null;
+ //private ILog moLog;
+ protected View currentView = View.List;
+ private Dictionary<String, Site> moSiteList = new Dictionary<String, Site>();
+ private String msSelectedSiteId;
+ private String msSelectedCategory;
+ private State _CurrentState = State.home;
+ private String msDownloadDir = Directory.GetCurrentDirectory()+"\\";
+ private List<VideoInfo> moCurrentVideoList = new List<VideoInfo>();
+ private String []msFilterArray;
+ private String msThumbLocation;
+ private int miSelectedIndex = 0;
+ private bool mbPlayFullscreen = true;
+ public enum State
+ {
+ home = 0,
+ categories = 1,
+ videos = 2
+ }
+ public enum View
+ {
+ List = 0,
+ Icons = 1,
+ LargeIcons = 2,
+ FilmStrip = 3
+ }
+ public class Site
+ {
+ public String name;
+ public String id;
+ public string username;
+ public string password;
+ public bool confirmAge;
+ public Dictionary<String, RssLink> RssList = new Dictionary<String, RssLink>();
+ }
+ public class RssLink
+ {
+ public String name;
+ public Boolean isDynamic = false;
+ public String url;
+ }
+ public class VideoInfo
+ {
+ public String Title;
+ public String Description;
+ public String VideoUrl;
+ public String ImageUrl;
+ public int Length;
+ public String Tags;
+ public Object Other;
+ public VideoInfo()
+ {
+ Length = -1;
+ }
+ }
+
+ public GUIOnlineVideos()
+ {
+ //ServiceProvider loServices = GlobalServiceProvider.Instance;
+ //moLog = loServices.Get<ILog>();
+ }
+ public string PluginName()
+ {
+
+ return "Online Videos";
+
+ }
+
+ // Returns the description of the plugin is shown in the plugin menu
+
+ public string Description()
+ {
+
+ return "Youtube Plugin";
+
+ }
+
+ // Returns the author of the plugin which is shown in the plugin menu
+
+ public string Author()
+ {
+
+ return "GregMac45";
+
+ }
+
+ // show the setup dialog
+
+ public void ShowPlugin()
+ {
+
+ //MessageBox.Show("Nothing to configure, this is just an example");
+
+ }
+
+ // Indicates whether plugin can be enabled/disabled
+
+ public bool CanEnable()
+ {
+
+ return true;
+
+ }
+
+ // get ID of windowplugin belonging to this setup
+
+ public int GetWindowId()
+ {
+
+ return GetID;
+
+ }
+
+ // Indicates if plugin is enabled by default;
+
+ public bool DefaultEnabled()
+ {
+
+ return true;
+
+ }
+
+ // indicates if a plugin has its own setup screen
+
+ public bool HasSetup()
+ {
+
+ return false;
+
+ }
+ public override int GetID
+ {
+ get
+ {
+ return 4755;
+ }
+ set
+ {
+ }
+ }
+
+ public override bool Init()
+ {
+ LoadSettings();
+ return Load(GUIGraphicsContext.Skin + @"\myonlinevideos.xml");
+
+ }
+ public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage)
+ {
+ strButtonText = PluginName();
+
+ strButtonImage = String.Empty;
+
+ strButtonImageFocus = String.Empty;
+
+ strPictureImage = String.Empty;
+
+ return true;
+ }
+ public bool ShowDefaultHome()
+ {
+ return true;
+ }
+ protected override void OnPageLoad()
+ {
+ if (_CurrentState == State.home)
+ {
+ //_log.Info("onPageLoad state home");
+ GUIPropertyManager.SetProperty("#header.label","Online Videos");
+ DisplaySites();
+ }
+ else if (_CurrentState == State.categories)
+ {
+ GUIPropertyManager.SetProperty("#header.label", moSiteList[msSelectedSiteId].name);
+ DisplayCategories();
+ }
+ else
+ {
+ GUIPropertyManager.SetProperty("#header.label", moSiteList[msSelectedSiteId].name);
+ DisplayVideos(false);
+ facadeView.SelectedListItemIndex = miSelectedIndex;
+ }
+ base.OnPageLoad();
+ }
+ protected override void OnShowContextMenu()
+ {
+ int liSelected = facadeView.SelectedListItemIndex-1;
+ if (liSelected < 0 || msSelectedSiteId=="99" || _CurrentState!=State.videos)
+ {
+ return;
+ }
+
+ GUIListItem loListItem = facadeView.SelectedListItem;
+ GUIDialogMenu dlgSel = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU);
+ dlgSel.Reset();
+ if (dlgSel != null)
+ {
+ dlgSel.Add("Save"); // Save
+ if(msSelectedSiteId=="1"){
+ dlgSel.Add("Related Videos"); // Related Videos
+ }
+ if(isSiteFavoriteEnabled()){
+ if(msSelectedCategory.StartsWith("fav:") ==false){
+ dlgSel.Add("Add to favorites");
+ }
+ else{
+ dlgSel.Add("Remove from favorites");
+ }
+ }
+ }
+ dlgSel.DoModal(GetID);
+ int liSelectedIdx = dlgSel.SelectedId;
+ Log.Info("Selected id {0}",liSelectedIdx);
+ switch(liSelectedIdx){
+ case 1:
+ SaveVideo(loListItem);
+ break;
+ case 2:
+ Log.Info("Getting related videos on {0} using tags:{1}",SiteUtilFactory.getSiteUtil(msSelectedSiteId),moCurrentVideoList[liSelected].Tags);
+ SiteUtilBase site = SiteUtilFactory.getSiteUtil(msSelectedSiteId);
+ Log.Info("VideoList before:");
+ foreach(VideoInfo video in moCurrentVideoList){
+ Log.Info(video.Title);
+ }
+ moCurrentVideoList = site.getRelatedVideos(moCurrentVideoList[liSelected].Tags);
+ Log.Info("VideoList after:");
+ foreach(VideoInfo video in moCurrentVideoList){
+ Log.Info(video.Title);
+ }
+ DisplayVideos(false);
+ break;
+ case 3:
+ SiteUtilBase siteUtil = SiteUtilFactory.getSiteUtil(msSelectedSiteId);
+ Site loSite = moSiteList [msSelectedSiteId];
+ if(msSelectedCategory.StartsWith("fav:") == false){
+ siteUtil.addFavorite(moCurrentVideoList[liSelected].VideoUrl,loSite.username,loSite.password);
+ }else{
+ siteUtil.removeFavorite(moCurrentVideoList[liSelected].VideoUrl,loSite.username,loSite.password);
+ }
+ break;
+ }
+ base.OnShowContextMenu();
+ }
+ public override void OnAction(Action action)
+ {
+ if (action.wID == Action.ActionType.ACTION_PREVIOUS_MENU)
+ {
+ if (_CurrentState == State.videos)
+ {
+ DisplayCategories();
+ _CurrentState = State.categories;
+ return;
+ }
+ else if (_CurrentState == State.categories)
+ {
+ DisplaySites();
+ _CurrentState = State.home;
+ return;
+ }
+ }
+ base.OnAction(action);
+ }
+ protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
+ {
+ Log.Info("Onclicked action type:{0}",actionType);
+ if (control == facadeView)
+ {
+
+ if (_CurrentState == State.home)
+ {
+ msSelectedSiteId = facadeView.SelectedListItem.Path;
+ GUIPropertyManager.SetProperty("#header.label", moSiteList[msSelectedSiteId].name);
+ DisplayCategories();
+ _CurrentState = State.categories;
+ }
+ else if (_CurrentState == State.categories)
+ {
+ if (facadeView.SelectedListItemIndex == 0)
+ {
+ DisplaySites();
+ _CurrentState = State.home;
+ }
+ else
+ {
+ msSelectedCategory = facadeView.SelectedListItem.Path;
+ DisplayVideos(true);
+ _CurrentState = State.videos;
+ }
+ }
+ else if (_CurrentState == State.videos)
+ {
+ ImageDownloader._stopDownload = true;
+ if (facadeView.SelectedListItemIndex == 0)
+ {
+ DisplayCategories();
+ _CurrentState = State.categories;
+ }
+ else
+ {
+ miSelectedIndex = facadeView.SelectedListItemIndex;
+ //play the video
+ Play(moCurrentVideoList[facadeView.SelectedListItemIndex -1]);
+ }
+ }
+ }
+ else if (control == btnViewAs)
+ {
+ //bool shouldContinue = false;
+ //do
+ //{
+ //shouldContinue = false;
+ switch (currentView)
+ {
+ case View.List:
+ currentView = View.Icons;
+ //if (!AllowView(CurrentView) || facadeView.ThumbnailView == null)
+ // shouldContinue = true;
+ //else
+ facadeView.View = GUIFacadeControl.ViewMode.SmallIcons;
+ break;
+ case View.Icons:
+ currentView = View.LargeIcons;
+ //if (!AllowView(CurrentView) || facadeView.ThumbnailView == null)
+ // shouldContinue = true;
+ //else
+ facadeView.View = GUIFacadeControl.ViewMode.LargeIcons;
+ //facadeView.
+ break;
+ case View.LargeIcons:
+ currentView = View.FilmStrip;
+ //if (!AllowView(CurrentView) || facadeView.FilmstripView == null)
+ // shouldContinue = true;
+ //else
+ facadeView.View = GUIFacadeControl.ViewMode.Filmstrip;
+ break;
+ ...
[truncated message content] |
|
From: <du...@us...> - 2007-04-13 13:11:34
|
Revision: 317
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=317&view=rev
Author: dukus
Date: 2007-04-13 06:11:31 -0700 (Fri, 13 Apr 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs
trunk/plugins/mpinstaler/MPInstaler/Form1.cs
trunk/plugins/mpinstaler/MPInstaler/MPInstaler.csproj
trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs
Added Paths:
-----------
trunk/plugins/mpinstaler/MPInstaler/properties.cs
Removed Paths:
-------------
trunk/plugins/mpinstaler/MPInstaler/MPInstaler_TemporaryKey.pfx
Modified: trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs 2007-04-12 18:16:51 UTC (rev 316)
+++ trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs 2007-04-13 13:11:31 UTC (rev 317)
@@ -51,6 +51,9 @@
this.skinToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.componentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mediaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.soundsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.animationsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.tetrisToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.languageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.textToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -78,6 +81,7 @@
this.textt_comboBox1 = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.tabPage_Advanced = new System.Windows.Forms.TabPage();
+ this.propertyGrid1 = new System.Windows.Forms.PropertyGrid();
this.button_browse = new System.Windows.Forms.Button();
this.label11 = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
@@ -105,9 +109,6 @@
this.openToolStripButton = new System.Windows.Forms.ToolStripButton();
this.saveToolStripButton = new System.Windows.Forms.ToolStripButton();
this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
- this.soundsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.animationsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.tetrisToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.tabPage_Skin.SuspendLayout();
@@ -233,7 +234,7 @@
this.tagReadersToolStripMenuItem,
this.externalPlayersToolStripMenuItem});
this.windowPluginToolStripMenuItem.Name = "windowPluginToolStripMenuItem";
- this.windowPluginToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.windowPluginToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
this.windowPluginToolStripMenuItem.Text = "Plugin";
//
// windowToolStripMenuItem
@@ -280,34 +281,55 @@
this.animationsToolStripMenuItem,
this.tetrisToolStripMenuItem});
this.skinToolStripMenuItem.Name = "skinToolStripMenuItem";
- this.skinToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.skinToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
this.skinToolStripMenuItem.Text = "Skin";
//
// componentToolStripMenuItem
//
this.componentToolStripMenuItem.Name = "componentToolStripMenuItem";
- this.componentToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.componentToolStripMenuItem.Size = new System.Drawing.Size(140, 22);
this.componentToolStripMenuItem.Text = "Component";
this.componentToolStripMenuItem.Click += new System.EventHandler(this.componentToolStripMenuItem_Click);
//
// mediaToolStripMenuItem
//
this.mediaToolStripMenuItem.Name = "mediaToolStripMenuItem";
- this.mediaToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.mediaToolStripMenuItem.Size = new System.Drawing.Size(140, 22);
this.mediaToolStripMenuItem.Text = "Media";
this.mediaToolStripMenuItem.Click += new System.EventHandler(this.mediaToolStripMenuItem_Click);
//
+ // soundsToolStripMenuItem
+ //
+ this.soundsToolStripMenuItem.Name = "soundsToolStripMenuItem";
+ this.soundsToolStripMenuItem.Size = new System.Drawing.Size(140, 22);
+ this.soundsToolStripMenuItem.Text = "Sounds";
+ this.soundsToolStripMenuItem.Click += new System.EventHandler(this.soundsToolStripMenuItem_Click);
+ //
+ // animationsToolStripMenuItem
+ //
+ this.animationsToolStripMenuItem.Name = "animationsToolStripMenuItem";
+ this.animationsToolStripMenuItem.Size = new System.Drawing.Size(140, 22);
+ this.animationsToolStripMenuItem.Text = "Animations";
+ this.animationsToolStripMenuItem.Click += new System.EventHandler(this.animationsToolStripMenuItem_Click);
+ //
+ // tetrisToolStripMenuItem
+ //
+ this.tetrisToolStripMenuItem.Name = "tetrisToolStripMenuItem";
+ this.tetrisToolStripMenuItem.Size = new System.Drawing.Size(140, 22);
+ this.tetrisToolStripMenuItem.Text = "Tetris";
+ this.tetrisToolStripMenuItem.Click += new System.EventHandler(this.tetrisToolStripMenuItem_Click);
+ //
// languageToolStripMenuItem
//
this.languageToolStripMenuItem.Name = "languageToolStripMenuItem";
- this.languageToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.languageToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
this.languageToolStripMenuItem.Text = "Language";
this.languageToolStripMenuItem.Click += new System.EventHandler(this.languageToolStripMenuItem_Click);
//
// textToolStripMenuItem
//
this.textToolStripMenuItem.Name = "textToolStripMenuItem";
- this.textToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.textToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
this.textToolStripMenuItem.Text = "Text";
this.textToolStripMenuItem.Click += new System.EventHandler(this.textToolStripMenuItem_Click);
//
@@ -315,20 +337,20 @@
//
this.settingsToolStripMenuItem.Enabled = false;
this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
- this.settingsToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.settingsToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
this.settingsToolStripMenuItem.Text = "Settings";
//
// textToolStripMenuItem1
//
this.textToolStripMenuItem1.Name = "textToolStripMenuItem1";
- this.textToolStripMenuItem1.Size = new System.Drawing.Size(152, 22);
+ this.textToolStripMenuItem1.Size = new System.Drawing.Size(132, 22);
this.textToolStripMenuItem1.Text = "Thumbs";
this.textToolStripMenuItem1.Click += new System.EventHandler(this.textToolStripMenuItem1_Click);
//
// otherToolStripMenuItem
//
this.otherToolStripMenuItem.Name = "otherToolStripMenuItem";
- this.otherToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.otherToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
this.otherToolStripMenuItem.Text = "Other";
this.otherToolStripMenuItem.Click += new System.EventHandler(this.otherToolStripMenuItem_Click);
//
@@ -519,6 +541,7 @@
//
// tabPage_Advanced
//
+ this.tabPage_Advanced.Controls.Add(this.propertyGrid1);
this.tabPage_Advanced.Controls.Add(this.button_browse);
this.tabPage_Advanced.Controls.Add(this.label11);
this.tabPage_Advanced.Controls.Add(this.pictureBox1);
@@ -529,6 +552,16 @@
this.tabPage_Advanced.Text = "Advanced Properties";
this.tabPage_Advanced.UseVisualStyleBackColor = true;
//
+ // propertyGrid1
+ //
+ this.propertyGrid1.CommandsVisibleIfAvailable = false;
+ this.propertyGrid1.Location = new System.Drawing.Point(342, 3);
+ this.propertyGrid1.Name = "propertyGrid1";
+ this.propertyGrid1.PropertySort = System.Windows.Forms.PropertySort.NoSort;
+ this.propertyGrid1.Size = new System.Drawing.Size(301, 114);
+ this.propertyGrid1.TabIndex = 3;
+ this.propertyGrid1.ToolbarVisible = false;
+ //
// button_browse
//
this.button_browse.Location = new System.Drawing.Point(0, 94);
@@ -811,27 +844,6 @@
this.toolStripContainer1.TabIndex = 5;
this.toolStripContainer1.Text = "toolStripContainer1";
//
- // soundsToolStripMenuItem
- //
- this.soundsToolStripMenuItem.Name = "soundsToolStripMenuItem";
- this.soundsToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
- this.soundsToolStripMenuItem.Text = "Sounds";
- this.soundsToolStripMenuItem.Click += new System.EventHandler(this.soundsToolStripMenuItem_Click);
- //
- // animationsToolStripMenuItem
- //
- this.animationsToolStripMenuItem.Name = "animationsToolStripMenuItem";
- this.animationsToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
- this.animationsToolStripMenuItem.Text = "Animations";
- this.animationsToolStripMenuItem.Click += new System.EventHandler(this.animationsToolStripMenuItem_Click);
- //
- // tetrisToolStripMenuItem
- //
- this.tetrisToolStripMenuItem.Name = "tetrisToolStripMenuItem";
- this.tetrisToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
- this.tetrisToolStripMenuItem.Text = "Tetris";
- this.tetrisToolStripMenuItem.Click += new System.EventHandler(this.tetrisToolStripMenuItem_Click);
- //
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -955,6 +967,7 @@
private System.Windows.Forms.ToolStripMenuItem soundsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem animationsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem tetrisToolStripMenuItem;
+ private System.Windows.Forms.PropertyGrid propertyGrid1;
}
}
Modified: trunk/plugins/mpinstaler/MPInstaler/Form1.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/Form1.cs 2007-04-12 18:16:51 UTC (rev 316)
+++ trunk/plugins/mpinstaler/MPInstaler/Form1.cs 2007-04-13 13:11:31 UTC (rev 317)
@@ -427,6 +427,9 @@
}
tabControl1.Controls.Add(tabPage_Proiect);
tabControl1.Controls.Add(tabPage_Advanced);
+ propertyGrid1.SelectedObject = _struct.ProiectProperties;
+ propertyGrid1.Update();
+
}
else
{
Modified: trunk/plugins/mpinstaler/MPInstaler/MPInstaler.csproj
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/MPInstaler.csproj 2007-04-12 18:16:51 UTC (rev 316)
+++ trunk/plugins/mpinstaler/MPInstaler/MPInstaler.csproj 2007-04-13 13:11:31 UTC (rev 317)
@@ -108,6 +108,7 @@
<DependentUpon>post_setup.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
+ <Compile Include="properties.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Build dialog.resx">
<SubType>Designer</SubType>
@@ -160,7 +161,6 @@
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.config" />
- <None Include="MPInstaler_TemporaryKey.pfx" />
<BaseApplicationManifest Include="Properties\app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
Deleted: trunk/plugins/mpinstaler/MPInstaler/MPInstaler_TemporaryKey.pfx
===================================================================
(Binary files differ)
Modified: trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs 2007-04-12 18:16:51 UTC (rev 316)
+++ trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs 2007-04-13 13:11:31 UTC (rev 317)
@@ -45,7 +45,7 @@
string _description = string.Empty;
string _group = string.Empty;
Image _image = null;
-
+ public ProiectPropertiesClass ProiectProperties;
public ArrayList Uninstall = new ArrayList();
public ArrayList FileList = new ArrayList();
public List<LanguageString> Language;
@@ -55,6 +55,7 @@
{
Language = new List<LanguageString>();
Actions = new List<ActionInfo>();
+ ProiectProperties = new ProiectPropertiesClass();
}
public string UpdateURL
{
Added: trunk/plugins/mpinstaler/MPInstaler/properties.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/properties.cs (rev 0)
+++ trunk/plugins/mpinstaler/MPInstaler/properties.cs 2007-04-13 13:11:31 UTC (rev 317)
@@ -0,0 +1,40 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace MPInstaler
+{
+ public class ProiectPropertiesClass
+ {
+ private string mpminversion;
+ private string mpmaxversion;
+
+ public ProiectPropertiesClass()
+ {
+ }
+
+ public string MPMinVersion
+ {
+ set
+ {
+ mpminversion = value;
+ }
+ get
+ {
+ return mpminversion;
+ }
+ }
+
+ public string MPMaxVersion
+ {
+ set
+ {
+ mpmaxversion = value;
+ }
+ get
+ {
+ return mpmaxversion;
+ }
+ }
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sa...@us...> - 2007-04-12 18:17:37
|
Revision: 316
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=316&view=rev
Author: saamand
Date: 2007-04-12 11:16:51 -0700 (Thu, 12 Apr 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRCTimeAndLineCollection.cs
trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj
trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs
trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj
trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj.user
trunk/plugins/MyLyrics/My Lyrics/MyLyricsSettings.cs
trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup.Designer.cs
trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup_LyricsLibrary.cs
trunk/plugins/MyLyrics/MyLyrics.suo
Modified: trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRCTimeAndLineCollection.cs
===================================================================
--- trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRCTimeAndLineCollection.cs 2007-04-12 07:54:06 UTC (rev 315)
+++ trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRCTimeAndLineCollection.cs 2007-04-12 18:16:51 UTC (rev 316)
@@ -4,7 +4,7 @@
namespace LRC
{
- public class SimpleLRCTimeAndLineCollection : IEnumerable
+ public class SimpleLRCTimeAndLineCollection : IEnumerable, ICollection
{
private object[] items = null;
@@ -15,11 +15,36 @@
Sort(items);
}
+ #region IEnumerable implementation
public IEnumerator GetEnumerator()
{
return new Enumerator(items);
}
+ #endregion
+ #region ICollection implementation
+ public int Count
+ {
+ get { return items.Length; }
+ }
+
+ public bool IsSynchronized
+ {
+ get { throw new Exception("The method or operation is not implemented."); }
+ }
+
+ public object SyncRoot
+ {
+ get { throw new Exception("The method or operation is not implemented."); }
+ }
+
+ public void CopyTo(Array array, int index)
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
+ #endregion
+
+ #region Enumerator class, IEnumerator implementation
private class Enumerator : IEnumerator
{
private int cursor;
@@ -63,14 +88,9 @@
}
}
}
+ #endregion
-
- private void Sort(object obj)
- {
- IComparer myComparer = new SortAfterTimeClass();
- Array.Sort(items, myComparer);
- }
-
+ #region SortAfterTimeClass class, IComparer implementation
public class SortAfterTimeClass : IComparer
{
// Calls CaseInsensitiveComparer.Compare with the parameters reversed.
@@ -80,6 +100,24 @@
}
}
+ #endregion
+
+ public string[] Copy()
+ {
+ string[] array = new string[this.Count];
+ for (int i = 0; i < this.Count; i++)
+ {
+ SimpleLRCTimeAndLine timeLine = (SimpleLRCTimeAndLine)items[i];
+ array.SetValue(timeLine.Line, i);
+ }
+ return array;
+ }
+
+ private void Sort(object obj)
+ {
+ IComparer myComparer = new SortAfterTimeClass();
+ Array.Sort(items, myComparer);
+ }
}
}
Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj
===================================================================
--- trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj 2007-04-12 07:54:06 UTC (rev 315)
+++ trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj 2007-04-12 18:16:51 UTC (rev 316)
@@ -69,6 +69,8 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
+ <None Include="app.config" />
+ <None Include="ClassDiagram1.cd" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs
===================================================================
--- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2007-04-12 07:54:06 UTC (rev 315)
+++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2007-04-12 18:16:51 UTC (rev 316)
@@ -1,6 +1,4 @@
-#define DEBUGGING
-
-using System;
+using System;
using System.Windows.Forms;
using System.Threading;
using System.Diagnostics;
@@ -36,10 +34,11 @@
public static int WINDOW_MYLYRICS = 90478;
private int selectedScreen = 0;
- string lyricsScreenXML = "";
+ string lyricsScreenXML = "MyLyrics.xml";
bool exitingMyLyrics = false;
- bool firstTime = false;
+ bool newTrack = false;
+ bool alreadyValidLRC = false;
// worker thread
Thread m_LyricControllerThread;
@@ -54,7 +53,6 @@
string m_TrackText = "";
string m_StatusText = "";
string m_LyricText = "";
- string m_Path = "";
bool lyricsFound = false;
@@ -69,36 +67,57 @@
#endregion
- #region Fields related to one of lyrics modes
+ #region GUI enums
+ enum GUI_General_Controls
+ {
+ CONTROL_BACKGROUND = 1,
+ CONTROL_LBStatus = 11
+ }
- enum LyricGUI_Controls
+ enum GUI_Lyrics_Controls
{
- CONTROL_BACKGROUND = 1,
- CONTROL_LBTrack = 10,
- CONTROL_LBStatus = 11,
CONTROL_Lyric = 20
}
+ enum GUI_LRC_Controls : int
+ {
+ CONTROL_ART_CURRENTLY = 24,
+ CONTROL_ART_DURATION = 25,
+ CONTROL_ART_ALBUM = 26,
+ CONTROL_ART_YEAR = 27,
+ CONTROL_ART_NOWPLAYINGBACK = 31,
+ CONTROL_ART_ALBUMART = 112,
+ CONTROL_ART_PROGRESS = 118,
+ CONTROL_ART_PROGRESSIMAGE = 117,
+
+ CONTROL_TAGBUTTON = 50,
+
+ CONTROL_EDIT_TIME = 600,
+ CONTROL_EDIT_LINE = 200,
+ CONTROL_EDIT_LINE_DONE = 300,
+
+ CONTROL_VIEW_LINE = 400,
+ CONTROL_VIEW_LINE_DONE = 500
+ }
#endregion
#region Fields related to LRC mode
- const int SHIFT_WHEN_HIT = 10;
+ internal const int BASIC_WIDE_LIMIT = 40;
LRC.SimpleLRC lrc;
IEnumerator enumerator;
System.Windows.Forms.Timer timer;
Stopwatch stopwatch;
string nextTimeToShow;
string nextLineToShow;
- int lineCounter;
#endregion
#region Fields releated to the editor mode
- internal const int TAG_IN_ROUND = 5;
- internal int currentLineToTagIndex = 1;
- internal int currentLineToTag_Total = 0;
+ internal const int TAG_IN_ROUND = 13;
+ internal int currentLRCLine = 0;
+ internal int LRCLinesTotal = 0;
internal int tagRoundFinished = 0;
internal int min = 0;
internal int sec = 0;
@@ -106,36 +125,6 @@
string[] lines;
ArrayList times;
-
- enum EditorGUI_Controls : int
- {
- CONTROL_BACKGROUND = 1,
- CONTROL_LBTrack = 10,
- CONTROL_LBStatus = 11,
-
- CONTROL_TAGBUTTON = 50,
-
- CONTROL_TIME = 100,
- CONTROL_TIME1 = 101,
- CONTROL_TIME2 = 102,
- CONTROL_TIME3 = 103,
- CONTROL_TIME4 = 104,
- CONTROL_TIME5 = 105,
-
- CONTROL_LINE = 200,
- CONTROL_LINE1 = 201,
- CONTROL_LINE2 = 202,
- CONTROL_LINE3 = 203,
- CONTROL_LINE4 = 204,
- CONTROL_LINE5 = 205,
-
- CONTROL_LINE_DONE = 300,
- CONTROL_LINE1_DONE = 301,
- CONTROL_LINE2_DONE = 302,
- CONTROL_LINE3_DONE = 303,
- CONTROL_LINE4_DONE = 304,
- CONTROL_LINE5_DONE = 305
- }
#endregion
@@ -159,356 +148,141 @@
{
case (int)MyLyricsSettings.Screen.LYRICS_BASIC:
selectedScreen = (int)MyLyricsSettings.Screen.LYRICS_BASIC;
- lyricsScreenXML = "MyLyrics.xml";
break;
case (int)MyLyricsSettings.Screen.LYRICS_WIDE:
selectedScreen = (int)MyLyricsSettings.Screen.LYRICS_WIDE;
- lyricsScreenXML = "MyLyricsWide.xml";
break;
case (int)MyLyricsSettings.Screen.LRC_BASIC:
selectedScreen = (int)MyLyricsSettings.Screen.LRC_BASIC;
- lyricsScreenXML = "MyLyricsLRC.xml";
break;
case (int)MyLyricsSettings.Screen.LRC_EDITOR:
selectedScreen = (int)MyLyricsSettings.Screen.LRC_EDITOR;
- lyricsScreenXML = "MyLyricsEditor.xml";
break;
default:
selectedScreen = (int)MyLyricsSettings.Screen.LYRICS_BASIC;
- lyricsScreenXML = "MyLyrics.xml";
break;
}
+ timer = new System.Windows.Forms.Timer();
+
return Load(GUIGraphicsContext.Skin + @"\" + lyricsScreenXML);
}
- public override void OnAction(Action action)
+
+ public override void Process()
{
- switch (action.wID)
+ if (newTrack)
{
- case Action.ActionType.ACTION_PREVIOUS_MENU:
+ alreadyValidLRC = false;
+
+ if (selectedScreen == (int)MyLyricsSettings.Screen.LRC_BASIC || selectedScreen == (int)MyLyricsSettings.Screen.LRC_WIDE)
{
- GUIWindowManager.ShowPreviousWindow();
- return;
- }
- }
- base.OnAction(action);
- }
+ lyricsFound = false;
+ StopThread();
+ newTrack = false;
- private void resetAll()
- {
+ MusicTag tag = new MusicTag();
+ tag.Artist = LyricUtil.capatalizeString(GUIPropertyManager.GetProperty("#Play.Current.Artist"));
+ tag.Title = LyricUtil.capatalizeString(GUIPropertyManager.GetProperty("#Play.Current.Title"));
+ m_artist = tag.Artist;
+ m_title = tag.Title;
- //deregister the handler!
- GUIPropertyManager.OnPropertyChanged -= this.trackChangeHandler;
-
- firstTime = false;
- exitingMyLyrics = true;
- m_artist = "";
- m_title = "";
- m_TrackText = "";
- m_StatusText = "";
- m_LyricText = "";
- m_Path = "";
- lyricsFound = false;
- m_LyricControllerThread = null;
- lc = null;
- m_sitesToSearch = null;
-
- resetLrcFields();
- }
-
- private void resetLrcFields()
- {
- if (timer != null)
- timer.Dispose();
- if (stopwatch != null)
- stopwatch.Reset();
- nextTimeToShow = "";
- nextLineToShow = "";
- lineCounter = 0;
- }
-
- public override bool OnMessage(GUIMessage message)
- {
- switch (message.Message)
- {
- case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT:
+ // Get lyric
+ if (!tag.Artist.Equals(""))
{
- exitingMyLyrics = false;
- base.OnMessage(message);
-
- LoadSettings();
-
- LyricDiagnostics.OpenLog(MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Log, logName));
- LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Start, 0, LyricDiagnostics.elapsedTimeString() + "MyLyrics opens, screen: " + lyricsScreenXML);
- return true;
+ findLyric(tag);
}
- case GUIMessage.MessageType.GUI_MSG_CLICKED:
+ else
{
+ m_artist = "";
+ m_title = "";
+ m_TrackText = "";
+ m_StatusText = "No music file playing";
+ GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_LBStatus, m_StatusText);
+ m_LyricText = "";
+ GUIControl.SetControlLabel(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric, m_LyricText);
+ }
+ }
+ else if (selectedScreen == (int)MyLyricsSettings.Screen.LRC_EDITOR)
+ {
+ newTrack = false;
- //get sender control
- int iControl = message.SenderControlId;
+ m_artist = LyricUtil.capatalizeString(GUIPropertyManager.GetProperty("#Play.Current.Artist"));
+ m_title = LyricUtil.capatalizeString(GUIPropertyManager.GetProperty("#Play.Current.Title"));
- if (selectedScreen == (int)MyLyricsSettings.Screen.LRC_EDITOR)
- {
- if (iControl == (int)EditorGUI_Controls.CONTROL_TAGBUTTON)
- {
- string time = "[" + min.ToString() + ":" + (sec.ToString().Length == 2 ? sec.ToString() : "0" + sec.ToString()) + "." + (stopwatch.ElapsedMilliseconds.ToString().Length == 3 ? stopwatch.ElapsedMilliseconds.ToString() : stopwatch.ElapsedMilliseconds.ToString() + "0") + "]";
- lines[currentLineToTag_Total] = time + lines[currentLineToTag_Total];
- GUIControl.SetControlLabel(GetID, (int)EditorGUI_Controls.CONTROL_TIME + currentLineToTagIndex, time);
- GUIControl.HideControl(GetID, (int)EditorGUI_Controls.CONTROL_LINE + currentLineToTagIndex);
-
- if (++currentLineToTag_Total < lines.Length)
- {
-
- // If a new round has to start
- if (++currentLineToTagIndex == TAG_IN_ROUND + 1)
- {
- currentLineToTagIndex = 1;
- ++tagRoundFinished;
-
- for (int i = 1; i <= TAG_IN_ROUND && currentLineToTag_Total + i < lines.Length ; i++)
- {
- GUIControl.ShowControl(GetID, (int)EditorGUI_Controls.CONTROL_LINE + i);
- GUIControl.SetControlLabel(GetID, (int)EditorGUI_Controls.CONTROL_TIME + i, "");
- GUIControl.SetControlLabel(GetID, (int)EditorGUI_Controls.CONTROL_LINE + i, lines[tagRoundFinished * TAG_IN_ROUND + i]);
- GUIControl.SetControlLabel(GetID, (int)EditorGUI_Controls.CONTROL_LINE_DONE + i, lines[tagRoundFinished * TAG_IN_ROUND + i]);
- }
- }
- }
- else
- {
- MessageBox.Show("The lyric has now completely been converted into a lrc!");
- StringBuilder lyric = new StringBuilder();
- for (int i = 0; i < lines.Length; i++)
- {
- lyric.Append(lines[i] + "\n");
- }
- lyric.Replace("\r", "");
-
- string artist = LyricUtil.capatalizeString(m_artist);
- string title = LyricUtil.capatalizeString(m_title);
- string lyricAsString = lyric.ToString();
-
- int lastLineShift = lyricAsString.LastIndexOf("\n");
- lyricAsString = lyricAsString.Substring(0, lastLineShift);
-
- LyricsItem item = new LyricsItem(artist, title, lyricAsString, "MP LRC-editor");
- LyricsDB[DatabaseUtil.CorrectKeyFormat(artist, title)] = item;
-
- string path = MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Database, LyricsDBName);
- using (FileStream fs = new FileStream(path, FileMode.Open))
- {
- BinaryFormatter bf = new BinaryFormatter();
- LyricsDB.SetLastModified();
- bf.Serialize(fs, LyricsDB);
- fs.Close();
- }
- }
-
- }
- }
- return true;
+ if (DatabaseUtil.IsTrackInLyricsDatabase(LyricsDB, m_artist, m_title).Equals(DatabaseUtil.LYRIC_FOUND))
+ {
+ LyricsItem item = LyricsDB[DatabaseUtil.CorrectKeyFormat(m_artist, m_title)];
+ m_LyricText = item.Lyrics;
+ showLRCtoEdit();
}
- case GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT:
+ else
{
- StopThread();
- resetAll();
- LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Stop, 0, LyricDiagnostics.elapsedTimeString() + "MyLyrics closes, screen: " + lyricsScreenXML);
- break;
+ startSearch();
}
- }
- return base.OnMessage(message);
- }
-
- //event driven handler to detect track change
- private void trackChangeHandler(string tag2, string value)
- {
- if (tag2.Equals("#Play.Current.Track") && !exitingMyLyrics) // track has changed
- {
- if (!value.Equals("")) // additional check
- {
- lyricsFound = false;
- StopThread();
-
- MusicTag tag = new MusicTag();
- tag.Artist = GUIPropertyManager.GetProperty("#Play.Current.Artist");
- tag.Title = GUIPropertyManager.GetProperty("#Play.Current.Title");
-
- findLyric(tag);
}
- else
+ else if (!exitingMyLyrics)
{
- m_artist = "";
- m_title = "";
- m_TrackText = "";
- GUIControl.SetControlLabel(GetID, (int)LyricGUI_Controls.CONTROL_LBTrack, m_StatusText);
- m_StatusText = "No music file playing";
- GUIControl.SetControlLabel(GetID, (int)LyricGUI_Controls.CONTROL_LBStatus, m_StatusText);
- m_LyricText = "";
- GUIControl.SetControlLabel(GetID, (int)LyricGUI_Controls.CONTROL_Lyric, m_LyricText);
+ startSearch();
}
}
+ base.Process();
}
- //event driven handler to detect track change
- private void timeHandler(string tag2, string value)
+ private void startSearch()
{
- if (tag2.Equals("#currentplaytime") && !exitingMyLyrics)
- {
- if (stopwatch != null && stopwatch.IsRunning)
- {
- stopwatch.Stop();
- }
+ lyricsFound = false;
+ StopThread();
+ newTrack = false;
- stopwatch = new Stopwatch();
- stopwatch.Start();
+ MusicTag tag = new MusicTag();
+ tag.Artist = LyricUtil.capatalizeString(GUIPropertyManager.GetProperty("#Play.Current.Artist"));
+ tag.Title = LyricUtil.capatalizeString(GUIPropertyManager.GetProperty("#Play.Current.Title"));
- string[] timeStrings = value.Split(':');
- min = int.Parse(timeStrings[0]);
- sec = int.Parse(timeStrings[1]);
-
- if (!value.Equals("")) // additional check
- {
- lyricsFound = false;
- StopThread();
-
- MusicTag tag = new MusicTag();
- tag.Artist = GUIPropertyManager.GetProperty("#Play.Current.Artist");
- tag.Title = GUIPropertyManager.GetProperty("#Play.Current.Title");
-
- findLyric(tag);
- }
- else
- {
- m_artist = "";
- m_title = "";
- m_TrackText = "";
- GUIControl.SetControlLabel(GetID, (int)LyricGUI_Controls.CONTROL_LBTrack, m_StatusText);
- m_StatusText = "No music file playing";
- GUIControl.SetControlLabel(GetID, (int)LyricGUI_Controls.CONTROL_LBStatus, m_StatusText);
- m_LyricText = "";
- GUIControl.SetControlLabel(GetID, (int)LyricGUI_Controls.CONTROL_Lyric, m_LyricText);
- }
+ if (!tag.Artist.Equals("")) findLyric(tag);
+ else
+ {
+ m_artist = "";
+ m_title = "";
+ m_TrackText = "";
+ m_StatusText = "No music file playing";
+ GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_LBStatus, m_StatusText);
+ m_LyricText = "";
+ GUIControl.SetControlLabel(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric, m_LyricText);
}
}
- public override void Process()
+ private void showLRCtoEdit()
{
- if (firstTime && selectedScreen == (int)MyLyricsSettings.Screen.LRC_EDITOR)
+ LRC.SimpleLRC lrc = new LRC.SimpleLRC(m_artist, m_title, m_LyricText);
+
+ if (lrc.IsValid)
{
- firstTime = false;
-
- string artist = LyricUtil.capatalizeString(GUIPropertyManager.GetProperty("#Play.Current.Artist"));
- string title = LyricUtil.capatalizeString(GUIPropertyManager.GetProperty("#Play.Current.Title"));
-
- string lyric = "";
-
- if (DatabaseUtil.IsTrackInLyricsDatabase(LyricsDB, artist, title).Equals(DatabaseUtil.LYRIC_FOUND))
- {
- LyricsItem item = LyricsDB[DatabaseUtil.CorrectKeyFormat(artist, title)];
- lyric = item.Lyrics;
-
- lines = lyric.Split(new string[1] { "\n" }, StringSplitOptions.None);
-
- for (int i = tagRoundFinished * TAG_IN_ROUND; i < (tagRoundFinished + 1) * TAG_IN_ROUND; i++)
- {
- GUIControl.SetControlLabel(GetID, (int)EditorGUI_Controls.CONTROL_LINE + i, lines[i]);
- GUIControl.SetControlLabel(GetID, (int)EditorGUI_Controls.CONTROL_LINE_DONE + i, lines[i]);
- }
- }
+ alreadyValidLRC = true;
+ lines = new string[1] { "This track already has a valid LRC!" };
}
- else if (firstTime && !exitingMyLyrics) //when mylyrics is opened while music is already playing, trackChangeHandler won't be called
+ else
{
- lyricsFound = false;
- StopThread();
- firstTime = false;
-
- MusicTag tag = new MusicTag();
- tag.Artist = GUIPropertyManager.GetProperty("#Play.Current.Artist");
- tag.Title = GUIPropertyManager.GetProperty("#Play.Current.Title");
-
- if (!tag.Artist.Equals("")) findLyric(tag);
- else
- {
- m_artist = "";
- m_title = "";
- m_TrackText = "";
- GUIControl.SetControlLabel(GetID, (int)LyricGUI_Controls.CONTROL_LBTrack, m_StatusText);
- m_StatusText = "No music file playing";
- GUIControl.SetControlLabel(GetID, (int)LyricGUI_Controls.CONTROL_LBStatus, m_StatusText);
- m_LyricText = "";
- GUIControl.SetControlLabel(GetID, (int)LyricGUI_Controls.CONTROL_Lyric, m_LyricText);
- }
+ lines = m_LyricText.Split(new string[1] { "\n" }, StringSplitOptions.None);
}
-
- /*
- if (isNewTrack() && exitingMyLyrics == false)
+ try
{
- lyricsFound = false;
- StopThread();
- m_Path = g_Player.CurrentFile;
- MusicTag tag = MediaPortal.TagReader.TagReader.ReadTag(m_Path);
-
-
- //quick and dirty CDA support hack :)
- if (g_Player.IsCDA)
- {
- tag = new MusicTag();
- tag.Artist = GUIPropertyManager.GetProperty("#Play.Current.Artist");
- tag.Title = GUIPropertyManager.GetProperty("#Play.Current.Title");
- }
-
- if (!m_Path.Equals(""))
+ for (int i = tagRoundFinished * TAG_IN_ROUND; i < (tagRoundFinished + 1) * TAG_IN_ROUND; i++)
{
- //findLyric(tag);
+ GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE + i, lines[i]);
+ GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE_DONE + i, lines[i]);
}
- else
- {
- m_artist = "";
- m_title = "";
- m_TrackText = "";
- GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LBTrack, m_StatusText);
- m_StatusText = "No music file playing";
- GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LBStatus, m_StatusText);
- m_LyricText = "";
- GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_Lyric, m_LyricText);
- }
- }*/
-
-
- base.Process();
+ }
+ catch { ;}
}
- private bool isNewTrack()
- {
- return !m_Path.Equals(g_Player.CurrentFile);
- }
-
void LoadSettings()
{
- firstTime = true;
+ newTrack = true;
- // Clear and update labels
- if (selectedScreen != (int)MyLyricsSettings.Screen.LRC_EDITOR)
- {
- GUIControl.ClearControl(GetID, (int)LyricGUI_Controls.CONTROL_LBStatus);
- GUIControl.SetControlLabel(GetID, (int)LyricGUI_Controls.CONTROL_LBStatus, m_StatusText);
- GUIControl.ClearControl(GetID, (int)LyricGUI_Controls.CONTROL_LBTrack);
- GUIControl.SetControlLabel(GetID, (int)LyricGUI_Controls.CONTROL_LBTrack, m_TrackText);
- GUIControl.ClearControl(GetID, (int)LyricGUI_Controls.CONTROL_Lyric);
- GUIControl.SetControlLabel(GetID, (int)LyricGUI_Controls.CONTROL_Lyric, m_LyricText);
+ resetGUI(selectedScreen);
- GUIPropertyManager.OnPropertyChanged += new GUIPropertyManager.OnPropertyChangedHandler(trackChangeHandler);
-
- times = new ArrayList();
- }
- else if(selectedScreen == (int)MyLyricsSettings.Screen.LRC_EDITOR)
- {
- GUIPropertyManager.OnPropertyChanged += new GUIPropertyManager.OnPropertyChangedHandler(timeHandler);
- }
-
bool useLyricWiki, useEvilLabs, useLyrics007, useLyricsOnDemand, useSeekLyrics, useHotLyrics;
using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml"))
@@ -567,6 +341,116 @@
{
}
+ public override bool OnMessage(GUIMessage message)
+ {
+ switch (message.Message)
+ {
+ case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT:
+ {
+ exitingMyLyrics = false;
+ base.OnMessage(message);
+
+ LoadSettings();
+
+ LyricDiagnostics.OpenLog(MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Log, logName));
+ LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Start, 0, LyricDiagnostics.elapsedTimeString() + "MyLyrics opens, screen: " + lyricsScreenXML);
+ return true;
+ }
+ case GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT:
+ {
+ StopThread();
+ resetAll();
+ LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Stop, 0, LyricDiagnostics.elapsedTimeString() + "MyLyrics closes, screen: " + lyricsScreenXML);
+ break;
+ }
+ }
+ return base.OnMessage(message);
+ }
+
+
+ public override void OnAction(Action action)
+ {
+ switch (action.wID)
+ {
+ case Action.ActionType.ACTION_PREVIOUS_MENU:
+ {
+ GUIWindowManager.ShowPreviousWindow();
+ break;
+ }
+ case Action.ActionType.ACTION_KEY_PRESSED:
+ {
+ if (action.m_key.KeyChar.Equals(13))
+ {
+ tagLine();
+ }
+ if (action.m_key.KeyChar.Equals(40))
+ {
+ lyricsFound = false;
+ if (selectedScreen != (int)MyLyricsSettings.Screen.LRC_EDITOR)
+ {
+ resetGUI((int)MyLyricsSettings.Screen.LRC_EDITOR);
+
+ }
+ else
+ {
+ // parameter could be anything but LRC_EDITOR. Will find correct type when running findLyric().
+ resetGUI((int)MyLyricsSettings.Screen.LYRICS_BASIC);
+ }
+
+ newTrack = true;
+ Process();
+ }
+ break;
+ }
+ }
+ base.OnAction(action);
+ }
+
+ //event driven handler to detect track change
+ private void trackChangeHandler(string tag2, string value)
+ {
+ if (tag2.Equals("#Play.Current.Track") && !exitingMyLyrics) // track has changed
+ {
+ if (!value.Equals("")) // additional check
+ {
+ resetGUI(selectedScreen);
+ StopThread();
+ resetAll();
+ newTrack = true;
+ Process();
+ }
+ else
+ {
+ m_artist = "";
+ m_title = "";
+ m_TrackText = "";
+ m_StatusText = "No music file playing";
+ GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_LBStatus, m_StatusText);
+ m_LyricText = "";
+ GUIControl.SetControlLabel(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric, m_LyricText);
+ }
+ }
+ }
+
+ //event driven handler to detect track change
+ private void timeHandler(string tag2, string value)
+ {
+ if (tag2.Equals("#currentplaytime") && !exitingMyLyrics)
+ {
+ if (stopwatch != null && stopwatch.IsRunning)
+ {
+ stopwatch.Stop();
+ }
+
+ stopwatch = new Stopwatch();
+ stopwatch.Start();
+
+ string[] timeStrings = value.Split(':');
+ min = int.Parse(timeStrings[0]);
+ sec = int.Parse(timeStrings[1]);
+ }
+ }
+
/// <summary>
/// findLyric searches for a lyric related to the given tag.
/// </summary>
@@ -576,17 +460,16 @@
{
m_EventStopThread.Reset();
- GUIControl.ClearControl(GetID, (int)LyricGUI_Controls.CONTROL_Lyric);
- GUIControl.SetControlLabel(GetID, (int)LyricGUI_Controls.CONTROL_Lyric, "");
+ GUIControl.ClearControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric);
+ GUIControl.SetControlLabel(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric, "");
if (tag != null && tag.Artist != "")
{
m_artist = tag.Artist.Trim();
m_title = tag.Title.Trim();
m_TrackText = m_artist + " - " + m_title;
- GUIControl.SetControlLabel(GetID, (int)LyricGUI_Controls.CONTROL_LBTrack, m_TrackText);
- m_StatusText = "Searching for a matching lyric. Please wait a moment...";
- GUIControl.SetControlLabel(GetID, (int)LyricGUI_Controls.CONTROL_LBStatus, m_StatusText);
+ m_StatusText = "Searching for a matching lyric...";
+ GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_LBStatus, m_StatusText);
LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.elapsedTimeString() + "findLyric(" + m_artist + ", " + m_title + ")");
@@ -604,36 +487,39 @@
if ((!tag.Lyrics.Equals("") && (lrc = new LRC.SimpleLRC(m_artist, m_title, tag.Lyrics)).IsValid)
|| (!lyricText.Equals("") && (lrc = new LRC.SimpleLRC(m_artist, m_title, lyricText)).IsValid))
{
-
resetLrcFields();
- m_StatusText = "";
- GUIControl.SetControlLabel(GetID, (int)LyricGUI_Controls.CONTROL_LBStatus, m_StatusText);
+ lines = lrc.SimpleLRCTimeAndLineCollection.Copy();
- if (lrc == null)
+ //Let's see if the basic or wide version of the LRC-screen should be shown
+ bool aLongLinePresent = false;
+ for (int i = 0; i < lines.Length; i++)
{
- MessageBox.Show("The lrc-file couldn't not be read properly." + Environment.NewLine + "The reading of the files was suspended.");
- return;
+ if (lines[i].Length > BASIC_WIDE_LIMIT)
+ {
+ aLongLinePresent = true;
+ break;
+ }
}
- else if (lrc.IsValid == false)
+
+ if (aLongLinePresent)
{
- MessageBox.Show("The selected file is not a valid lrc-file.");
- return;
+ resetGUI((int)MyLyricsSettings.Screen.LRC_WIDE);
}
- else if (lrc.Lyric.Equals(""))
+ else
{
- MessageBox.Show("The lrc-file couldn't not be read properly." + Environment.NewLine + "It seemed to be empty.");
- return;
+ resetGUI((int)MyLyricsSettings.Screen.LRC_BASIC);
}
+ m_StatusText = "";
+ GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_LBStatus, m_StatusText);
+
enumerator = lrc.SimpleLRCTimeAndLineCollection.GetEnumerator();
if (!lrc.Artist.Equals("") && !lrc.Title.Equals(""))
{
m_StatusText = "";
m_LyricText = "";
- GUIControl.ClearControl(GetID, (int)LyricGUI_Controls.CONTROL_LBStatus);
- GUIControl.ClearControl(GetID, (int)LyricGUI_Controls.CONTROL_Lyric);
// setup timer and stopwatch
timer = new System.Windows.Forms.Timer();
@@ -647,6 +533,16 @@
timer.Start();
stopwatch.Start();
}
+
+ try
+ {
+ for (int i = tagRoundFinished * TAG_IN_ROUND; i < (tagRoundFinished + 1) * TAG_IN_ROUND; i++)
+ {
+ GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE + i, lines[i]);
+ GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE_DONE + i, lines[i]);
+ }
+ }
+ catch { ;}
}
// 2) Lyric in music tag
@@ -658,7 +554,7 @@
// 3) if lyric in music database
else if (!lyricText.Equals(""))
{
- LyricFound = new Object[] { lyricText, m_artist, m_title, "lyric database" };
+ LyricFound = new Object[] { lyricText, m_artist, m_title, "lyrics database" };
}
// 4) if no lyric found, search the Internet for it using the LyricEngine
@@ -684,56 +580,143 @@
else
{
m_TrackText = "";
- GUIControl.SetControlLabel(GetID, (int)LyricGUI_Controls.CONTROL_LBTrack, m_StatusText);
m_StatusText = "The music tag isn't complete";
- GUIControl.SetControlLabel(GetID, (int)LyricGUI_Controls.CONTROL_LBStatus, m_StatusText);
+ GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_LBStatus, m_StatusText);
return;
}
}
+ private void tagLine()
+ {
+ if (alreadyValidLRC == false && selectedScreen == (int)MyLyricsSettings.Screen.LRC_EDITOR)
+ {
+ string time = "[" + min.ToString() + ":" + (sec.ToString().Length == 2 ? sec.ToString() : "0" + sec.ToString()) + "." + (stopwatch.ElapsedMilliseconds.ToString().Length == 3 ? stopwatch.ElapsedMilliseconds.ToString() : stopwatch.ElapsedMilliseconds.ToString() + "0") + "]";
+ lines[LRCLinesTotal] = time + lines[LRCLinesTotal];
+ GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_TIME + currentLRCLine, time);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE + currentLRCLine);
+
+ if (++LRCLinesTotal < lines.Length)
+ {
+
+ // If a new round has to start
+ if (++currentLRCLine == TAG_IN_ROUND)
+ {
+ currentLRCLine = 0;
+ ++tagRoundFinished;
+
+ try
+ {
+ for (int i = 0; i < TAG_IN_ROUND && LRCLinesTotal + i < lines.Length; i++)
+ {
+ GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE + i);
+ GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_TIME + i, "");
+ GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE + i, lines[tagRoundFinished * TAG_IN_ROUND + i]);
+ GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE_DONE + i, lines[tagRoundFinished * TAG_IN_ROUND + i]);
+ }
+ }
+ catch { ;}
+ }
+ }
+ else
+ {
+ MessageBox.Show("The lyric has now completely been converted into a lrc!");
+ StringBuilder lyric = new StringBuilder();
+ for (int i = 0; i < lines.Length; i++)
+ {
+ lyric.Append(lines[i] + "\n");
+ }
+ lyric.Replace("\r", "");
+
+ string artist = LyricUtil.capatalizeString(m_artist);
+ string title = LyricUtil.capatalizeString(m_title);
+ string lyricAsString = lyric.ToString();
+
+ int lastLineShift = lyricAsString.LastIndexOf("\n");
+ lyricAsString = lyricAsString.Substring(0, lastLineShift);
+
+ LyricsItem item = new LyricsItem(artist, title, lyricAsString, "LRC-editor screen");
+ LyricsDB[DatabaseUtil.CorrectKeyFormat(artist, title)] = item;
+
+ string path = MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Database, LyricsDBName);
+ using (FileStream fs = new FileStream(path, FileMode.Open))
+ {
+ BinaryFormatter bf = new BinaryFormatter();
+ LyricsDB.SetLastModified();
+ bf.Serialize(fs, LyricsDB);
+ fs.Close();
+ }
+ }
+ }
+ }
+
public void OnTimerEvent(object source, EventArgs e)
{
- // If the max number of lyrics on screen has been added, then reset the counter and start over again
- if (++lineCounter > SHIFT_WHEN_HIT)
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE + currentLRCLine);
+ GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE_DONE + currentLRCLine);
+
+ if (++LRCLinesTotal < lines.Length)
{
- lineCounter = 0;
- m_LyricText = "";
- GUIControl.ClearControl(GetID, (int)LyricGUI_Controls.CONTROL_Lyric);
+
+ // If a new round has to start
+ if (++currentLRCLine == TAG_IN_ROUND)
+ {
+ currentLRCLine = 0;
+ ++tagRoundFinished;
+
+ try
+ {
+ resetGUI(selectedScreen);
+ for (int i = 0; i < TAG_IN_ROUND; i++)
+ {
+ GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE + i);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE_DONE + i);
+ GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE + i, lines[tagRoundFinished * TAG_IN_ROUND + i]);
+ GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE_DONE + i, lines[tagRoundFinished * TAG_IN_ROUND + i]);
+ }
+ }
+ catch {;};
+ }
}
- m_LyricText += (nextLineToShow);
- GUIControl.SetControlLabel(GetID, (int)LyricGUI_Controls.CONTROL_Lyric, m_LyricText);
+
calculateNextInterval();
}
private void calculateNextInterval()
{
- if (enumerator.MoveNext())
+ if (selectedScreen == (int)MyLyricsSettings.Screen.LRC_BASIC || selectedScreen == (int)MyLyricsSettings.Screen.LRC_WIDE)
{
- LRC.SimpleLRCTimeAndLine currentLine = (LRC.SimpleLRCTimeAndLine)enumerator.Current;
- while (currentLine.Time == 0)
+ if (enumerator.MoveNext())
{
- m_LyricText += (currentLine.Line);
- GUIControl.SetControlLabel(GetID, (int)LyricGUI_Controls.CONTROL_Lyric, m_LyricText);
+ LRC.SimpleLRCTimeAndLine currentLine = (LRC.SimpleLRCTimeAndLine)enumerator.Current;
+ while (currentLine.Time == 0)
+ {
+ m_LyricText += (currentLine.Line);
+ GUIControl.SetControlLabel(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric, m_LyricText);
- ++lineCounter;
- enumerator.MoveNext();
- currentLine = (LRC.SimpleLRCTimeAndLine)enumerator.Current;
- }
+ ++currentLRCLine;
+ enumerator.MoveNext();
+ currentLine = (LRC.SimpleLRCTimeAndLine)enumerator.Current;
+ }
- nextTimeToShow = currentLine.TimeString;
- nextLineToShow = currentLine.Line;
- //MessageBox.Show(g_Player.CurrentPosition.ToString());
- int temp = (int)(currentLine.Time - (int)(g_Player.CurrentPosition * 1000));
- if (temp > 0)
- {
- timer.Interval = temp;
+ nextTimeToShow = currentLine.TimeString;
+ nextLineToShow = currentLine.Line;
+
+ int temp = (int)(currentLine.Time - (int)(g_Player.CurrentPosition * 1000));
+ if (temp > 0)
+ {
+ timer.Interval = temp;
+ }
+ else
+ {
+ //MessageBox.Show("temp: " + temp);
+ }
}
else
{
- //MessageBox.Show("temp: " + temp);
+ timer.Stop();
+ stopwatch.Stop();
+ timer.Dispose();
}
-
- // lbTestSecondsLeft.Text = ((long)(stopwatch.ElapsedMilliseconds / 1000)).ToString();
}
else
{
@@ -752,9 +735,17 @@
m_LyricText = lyricText;
m_StatusText = "";
+ GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_LBStatus, m_StatusText);
- GUIControl.SetControlLabel(GetID, (int)LyricGUI_Controls.CONTROL_LBStatus, m_StatusText);
- GUIControl.SetControlLabel(GetID, (int)LyricGUI_Controls.CONTROL_Lyric, m_LyricText);
+ if (selectedScreen == (int)MyLyricsSettings.Screen.LRC_EDITOR)
+ {
+ showLRCtoEdit();
+ }
+ else
+ {
+ resetGUI((int)MyLyricsSettings.Screen.LYRICS_BASIC);
+ GUIControl.SetControlLabel(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric, m_LyricText);
+ }
}
private void SaveLyricToDatabase(string site)
@@ -797,7 +788,6 @@
{
if (m_LyricControllerThread != null && m_LyricControllerThread.IsAlive) // thread is active
{
- //GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LBStatus, m_StatusText);
// set event "Stop"
m_EventStopThread.Set();
@@ -806,6 +796,240 @@
}
}
+
+ private void resetAll()
+ {
+
+ //deregister the handler!
+ //GUIPropertyManager.OnPropertyChanged -= this.trackChangeHandler;
+
+ newTrack = false;
+ exitingMyLyrics = false;
+ m_artist = "";
+ m_title = "";
+ m_TrackText = "";
+ m_StatusText = "";
+ m_LyricText = "";
+ lyricsFound = false;
+ m_LyricControllerThread = null;
+ lc = null;
+
+ resetLrcFields();
+ }
+
+ private void resetLrcFields()
+ {
+ if (timer != null)
+ timer.Dispose();
+ if (stopwatch != null)
+ stopwatch.Reset();
+ nextTimeToShow = "";
+ nextLineToShow = "";
+ currentLRCLine = 0;
+ LRCLinesTotal = 0;
+ tagRoundFinished = 0;
+ min = 0;
+ sec = 0;
+ msec = 0;
+ lines = null;
+ times = null;
+ }
+
+ private void resetGUI(int screenID)
+ {
+ selectedScreen = screenID;
+
+ GUIPropertyManager.OnPropertyChanged -= new GUIPropertyManager.OnPropertyChangedHandler(trackChangeHandler);
+ GUIPropertyManager.OnPropertyChanged -= new GUIPropertyManager.OnPropertyChangedHandler(timeHandler);
+ timer.Tick -= new System.EventHandler(OnTimerEvent);
+
+ if (selectedScreen == (int)MyLyricsSettings.Screen.LYRICS_BASIC)
+ {
+ GUIPropertyManager.OnPropertyChanged += new GUIPropertyManager.OnPropertyChangedHandler(trackChangeHandler);
+ times = new ArrayList();
+
+ // Reset general and lyrics controls
+ GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_LBStatus);
+ GUIControl.ShowControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric);
+ GUIControl.SetControlLabel(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric, "");
+
+ // album art only visible for basic screen
+ GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_CURRENTLY);
+ GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_DURATION);
+ GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUM);
+ GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_YEAR);
+ GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_NOWPLAYINGBACK);
+ GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUMART);
+ GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESS);
+ GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESSIMAGE);
+
+ // Hide LRC controls
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_TAGBUTTON);
+
+ for (int i = 0; i < TAG_IN_ROUND; i++)
+ {
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_TIME + i);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE + i);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE_DONE + i);
+
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE + i);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE_DONE + i);
+ }
+ }
+
+ else if (selectedScreen == (int)MyLyricsSettings.Screen.LYRICS_WIDE)
+ {
+ GUIPropertyManager.OnPropertyChanged += new GUIPropertyManager.OnPropertyChangedHandler(trackChangeHandler);
+ times = new ArrayList();
+
+ // Reset general and lyrics controls
+ GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_LBStatus);
+ //GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_LBStatus, "");
+ GUIControl.ShowControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric);
+ GUIControl.SetControlLabel(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric, "");
+
+ // album art only visible for lyrics_basic screen
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_CURRENTLY);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_DURATION);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUM);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_YEAR);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_NOWPLAYINGBACK);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUMART);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESS);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESSIMAGE);
+
+ // Hide LRC controls
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_TAGBUTTON);
+
+ for (int i = 0; i < TAG_IN_ROUND; i++)
+ {
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_TIME + i);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE + i);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE_DONE + i);
+
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE + i);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE_DONE + i);
+ }
+ }
+
+ else if (selectedScreen == (int)MyLyricsSettings.Screen.LRC_BASIC)
+ {
+ if (alreadyValidLRC == false)
+ {
+ GUIPropertyManager.OnPropertyChanged += new GUIPropertyManager.OnPropertyChangedHandler(trackChangeHandler);
+ GUIPropertyManager.OnPropertyChanged += new GUIPropertyManager.OnPropertyChangedHandler(timeHandler);
+ timer.Tick += new System.EventHandler(OnTimerEvent);
+ }
+
+ // Lyrics controls
+ GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_LBStatus);
+ GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_LBStatus, "");
+ GUIControl.HideControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric);
+
+ // album art only visible for basic screen
+ GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_CURRENTLY);
+ GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_DURATION);
+ GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUM);
+ GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_YEAR);
+ GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_NOWPLAYINGBACK);
+ GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUMART);
+ GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESS);
+ GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESSIMAGE);
+
+ // LRC controls
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_TAGBUTTON);
+
+ for (int i = 0; i < TAG_IN_ROUND; i++)
+ {
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_TIME + i);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE + i);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE_DONE + i);
+
+ GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE + i);
+ GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE + i, "");
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE_DONE + i);
+ GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE_DONE + i, "");
+ }
+ }
+
+ else if (selectedScreen == (int)MyLyricsSettings.Screen.LRC_WIDE)
+ {
+ if (alreadyValidLRC == false)
+ {
+ GUIPropertyManager.OnPropertyChanged += new GUIPropertyManager.OnPropertyChangedHandler(trackChangeHandler);
+ GUIPropertyManager.OnPropertyChanged += new GUIPropertyManager.OnPropertyChangedHandler(timeHandler);
+ timer.Tick += new System.EventHandler(OnTimerEvent);
+ }
+
+ // Lyrics controls
+ GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_LBStatus);
+ GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_LBStatus, "");
+ GUIControl.HideControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric);
+
+ // album art only visible for basic screen
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_CURRENTLY);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_DURATION);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUM);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_YEAR);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_NOWPLAYINGBACK);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUMART);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESS);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESSIMAGE);
+
+ // LRC controls
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_TAGBUTTON);
+
+ for (int i = 0; i < TAG_IN_ROUND; i++)
+ {
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_TIME + i);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE + i);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE_DONE + i);
+
+ GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE + i);
+ GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE + i, "");
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE_DONE + i);
+ GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE_DONE + i, "");
+ }
+ }
+
+ else if (selectedScreen == (int)MyLyricsSettings.Screen.LRC_EDITOR)
+ {
+ GUIPropertyManager.OnPropertyChanged += new GUIPropertyManager.OnPropertyChangedHandler(trackChangeHandler);
+ GUIPropertyManager.OnPropertyChanged += new GUIPropertyManager.OnPropertyChangedHandler(timeHandler);
+
+ // Lyrics controls
+ GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_LBStatus);
+ GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_LBStatus, "");
+ GUIControl.HideControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric);
+
+ // album art only visible for lyrics_basic screen
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_CURRENTLY);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_DURATION);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUM);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_YEAR);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_NOWPLAYINGBACK);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUMART);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESS);
+ GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESSIMAGE);
+
+ // LRC controls
+ GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_TAGBUTTON);
+
+ for (int i = 0; i < TAG_IN_ROUND; i++)
+ {
+ GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_TIME + i);
+...
[truncated message content] |
|
From: <mis...@us...> - 2007-04-12 07:54:08
|
Revision: 315
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=315&view=rev
Author: misterd_sf
Date: 2007-04-12 00:54:06 -0700 (Thu, 12 Apr 2007)
Log Message:
-----------
MPlayer: Fixed white border issue in playback
Modified Paths:
--------------
trunk/plugins/My MPlayer/MPlayer_ExtPlayer/MPlayer_ExtPlayer.cs
Modified: trunk/plugins/My MPlayer/MPlayer_ExtPlayer/MPlayer_ExtPlayer.cs
===================================================================
--- trunk/plugins/My MPlayer/MPlayer_ExtPlayer/MPlayer_ExtPlayer.cs 2007-04-12 07:31:26 UTC (rev 314)
+++ trunk/plugins/My MPlayer/MPlayer_ExtPlayer/MPlayer_ExtPlayer.cs 2007-04-12 07:54:06 UTC (rev 315)
@@ -449,7 +449,7 @@
mplayerBackgroundPanel.Size = new System.Drawing.Size(0, 0);
mplayerBackgroundPanel.Location = new Point(0, 0);
mplayerOuterPanel = new Panel();
- mplayerOuterPanel.BackColor = Color.FromArgb(0, 0, 0, 0); ;
+ mplayerOuterPanel.BackColor = Color.Black;
mplayerOuterPanel.Size = new System.Drawing.Size(0, 0);
mplayerOuterPanel.Location = new Point(0, 0);
mplayerInnerPanel = new Panel();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mis...@us...> - 2007-04-12 07:31:31
|
Revision: 314
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=314&view=rev
Author: misterd_sf
Date: 2007-04-12 00:31:26 -0700 (Thu, 12 Apr 2007)
Log Message:
-----------
MPlayer: Removed old VirtualWebKeyboard, because it doesn't work proberly with latest SVN.
Modified Paths:
--------------
trunk/plugins/My MPlayer/MPlayer_GUIPlugin/MPlayer_GUIPlugin.cs
trunk/plugins/My MPlayer/MPlayer_GUIPlugin/MPlayer_GUIPlugin.csproj
Removed Paths:
-------------
trunk/plugins/My MPlayer/MPlayer_GUIPlugin/VirtualWebKeyboard.cs
Modified: trunk/plugins/My MPlayer/MPlayer_GUIPlugin/MPlayer_GUIPlugin.cs
===================================================================
--- trunk/plugins/My MPlayer/MPlayer_GUIPlugin/MPlayer_GUIPlugin.cs 2007-04-11 19:10:20 UTC (rev 313)
+++ trunk/plugins/My MPlayer/MPlayer_GUIPlugin/MPlayer_GUIPlugin.cs 2007-04-12 07:31:26 UTC (rev 314)
@@ -45,872 +45,872 @@
using MediaPortal.Configuration;
namespace MPlayer {
+ /// <summary>
+ /// Window plugin for the MPlayer External player plugin
+ /// </summary>
+ public class MPlayer_GUIPlugin : GUIWindow, IShowPlugin, ISetupForm {
+ #region enum
/// <summary>
- /// Window plugin for the MPlayer External player plugin
+ /// Possible View
/// </summary>
- public class MPlayer_GUIPlugin : GUIWindow, IShowPlugin, ISetupForm {
- #region enum
- /// <summary>
- /// Possible View
- /// </summary>
- public enum View {
- /// <summary>
- /// List view
- /// </summary>
- List = 0,
- /// <summary>
- /// Icon view
- /// </summary>
- Icons = 1,
- /// <summary>
- /// Large icon view
- /// </summary>
- LargeIcons = 2,
- /// <summary>
- /// Filmstrip view
- /// </summary>
- FilmStrip = 3
- }
- #endregion
+ public enum View {
+ /// <summary>
+ /// List view
+ /// </summary>
+ List = 0,
+ /// <summary>
+ /// Icon view
+ /// </summary>
+ Icons = 1,
+ /// <summary>
+ /// Large icon view
+ /// </summary>
+ LargeIcons = 2,
+ /// <summary>
+ /// Filmstrip view
+ /// </summary>
+ FilmStrip = 3
+ }
+ #endregion
- #region variables
- /// <summary>
- /// Virutal Directory
- /// </summary>
- private VirtualDirectory m_directory = new VirtualDirectory();
+ #region variables
+ /// <summary>
+ /// Virutal Directory
+ /// </summary>
+ private VirtualDirectory m_directory = new VirtualDirectory();
- /// <summary>
- /// ViewAs Button
- /// </summary>
- [SkinControlAttribute(2)]
- private GUIButtonControl btnViewAs = null;
+ /// <summary>
+ /// ViewAs Button
+ /// </summary>
+ [SkinControlAttribute(2)]
+ private GUIButtonControl btnViewAs = null;
- /// <summary>
- /// SortBy Button
- /// </summary>
- [SkinControlAttribute(3)]
- private GUISortButtonControl btnSortBy = null;
+ /// <summary>
+ /// SortBy Button
+ /// </summary>
+ [SkinControlAttribute(3)]
+ private GUISortButtonControl btnSortBy = null;
- /// <summary>
- /// PlayStream Button
- /// </summary>
- [SkinControlAttribute(5)]
- private GUIButtonControl btnPlayStream = null;
+ /// <summary>
+ /// PlayStream Button
+ /// </summary>
+ [SkinControlAttribute(5)]
+ private GUIButtonControl btnPlayStream = null;
- /// <summary>
- /// PlayDisc Button
- /// </summary>
- [SkinControlAttribute(6)]
- private GUIButtonControl btnPlayDisc = null;
+ /// <summary>
+ /// PlayDisc Button
+ /// </summary>
+ [SkinControlAttribute(6)]
+ private GUIButtonControl btnPlayDisc = null;
- /// <summary>
- /// Delete Button
- /// </summary>
- [SkinControlAttribute(7)]
- private GUIButtonControl btnDelete = null;
+ /// <summary>
+ /// Delete Button
+ /// </summary>
+ [SkinControlAttribute(7)]
+ private GUIButtonControl btnDelete = null;
- /// <summary>
- /// FacadeView
- /// </summary>
- [SkinControlAttribute(50)]
- private GUIFacadeControl facadeView = null;
+ /// <summary>
+ /// FacadeView
+ /// </summary>
+ [SkinControlAttribute(50)]
+ private GUIFacadeControl facadeView = null;
- /// <summary>
- /// Current view mode
- /// </summary>
- private View currentView;
+ /// <summary>
+ /// Current view mode
+ /// </summary>
+ private View currentView;
- /// <summary>
- /// Current sort method
- /// </summary>
- private VideoSort.SortMethod currentSortMethod;
+ /// <summary>
+ /// Current sort method
+ /// </summary>
+ private VideoSort.SortMethod currentSortMethod;
- /// <summary>
- /// Indicator, if ascending sort is selected
- /// </summary>
- private bool m_bSortAscending;
+ /// <summary>
+ /// Indicator, if ascending sort is selected
+ /// </summary>
+ private bool m_bSortAscending;
- /// <summary>
- /// Playlistplayer instance
- /// </summary>
- private static PlayListPlayer playlistPlayer;
+ /// <summary>
+ /// Playlistplayer instance
+ /// </summary>
+ private static PlayListPlayer playlistPlayer;
- /// <summary>
- /// Current virtual Path
- /// </summary>
- private string virtualPath;
+ /// <summary>
+ /// Current virtual Path
+ /// </summary>
+ private string virtualPath;
- /// <summary>
- /// Display name of the plugin
- /// </summary>
- private string displayName;
- /// <summary>
- /// Indicates if the my video Shares are used
- /// </summary>
- private bool useMyVideoShares;
- /// <summary>
- /// Indicates if the my music Shares are used
- /// </summary>
- private bool useMyMusicShares;
- /// <summary>
- /// List of path of all shares
- /// </summary>
- private List<String> sharePaths;
- #endregion
+ /// <summary>
+ /// Display name of the plugin
+ /// </summary>
+ private string displayName;
+ /// <summary>
+ /// Indicates if the my video Shares are used
+ /// </summary>
+ private bool useMyVideoShares;
+ /// <summary>
+ /// Indicates if the my music Shares are used
+ /// </summary>
+ private bool useMyMusicShares;
+ /// <summary>
+ /// List of path of all shares
+ /// </summary>
+ private List<String> sharePaths;
+ #endregion
- #region ctor
- /// <summary>
- /// Static Constructor for the Playlistplayer instance
- /// </summary>
- static MPlayer_GUIPlugin() {
- playlistPlayer = PlayListPlayer.SingletonPlayer;
- }
+ #region ctor
+ /// <summary>
+ /// Static Constructor for the Playlistplayer instance
+ /// </summary>
+ static MPlayer_GUIPlugin() {
+ playlistPlayer = PlayListPlayer.SingletonPlayer;
+ }
- /// <summary>
- /// Standard constructor which set the WindowID
- /// </summary>
- public MPlayer_GUIPlugin() {
- GetID = 9533;
- virtualPath = String.Empty;
- using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) {
- displayName = xmlreader.GetValueAsString("mplayer", "displayNameOfGUI", "My MPlayer");
- useMyVideoShares = xmlreader.GetValueAsBool("mplayer", "useMyVideoShares", true);
- useMyMusicShares = xmlreader.GetValueAsBool("mplayer", "useMyMusicShares", true);
- }
- }
- #endregion
+ /// <summary>
+ /// Standard constructor which set the WindowID
+ /// </summary>
+ public MPlayer_GUIPlugin() {
+ GetID = 9533;
+ virtualPath = String.Empty;
+ using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) {
+ displayName = xmlreader.GetValueAsString("mplayer", "displayNameOfGUI", "My MPlayer");
+ useMyVideoShares = xmlreader.GetValueAsBool("mplayer", "useMyVideoShares", true);
+ useMyMusicShares = xmlreader.GetValueAsBool("mplayer", "useMyMusicShares", true);
+ }
+ }
+ #endregion
- #region GUI methods
- /// <summary>
- /// Gets/Sets the current view mode
- /// </summary>
- protected virtual View CurrentView {
- get { return currentView; }
- set { currentView = value; }
- }
+ #region GUI methods
+ /// <summary>
+ /// Gets/Sets the current view mode
+ /// </summary>
+ protected virtual View CurrentView {
+ get { return currentView; }
+ set { currentView = value; }
+ }
- /// <summary>
- /// Gets/Sets the current sort method
- /// </summary>
- protected virtual VideoSort.SortMethod CurrentSortMethod {
- get { return currentSortMethod; }
- set { currentSortMethod = value; }
- }
+ /// <summary>
+ /// Gets/Sets the current sort method
+ /// </summary>
+ protected virtual VideoSort.SortMethod CurrentSortMethod {
+ get { return currentSortMethod; }
+ set { currentSortMethod = value; }
+ }
- /// <summary>
- /// Gets/Sets the current sorting direction
- /// </summary>
- protected virtual bool CurrentSortAsc {
- get { return m_bSortAscending; }
- set { m_bSortAscending = value; }
- }
+ /// <summary>
+ /// Gets/Sets the current sorting direction
+ /// </summary>
+ protected virtual bool CurrentSortAsc {
+ get { return m_bSortAscending; }
+ set { m_bSortAscending = value; }
+ }
- /// <summary>
- /// Inits the window plugin
- /// </summary>
- /// <returns>true, if init was successful</returns>
- public override bool Init() {
- bool bResult = Load(GUIGraphicsContext.Skin + @"\myMPlayer.xml");
- initializeVirtualDirectory();
- return bResult;
+ /// <summary>
+ /// Inits the window plugin
+ /// </summary>
+ /// <returns>true, if init was successful</returns>
+ public override bool Init() {
+ bool bResult = Load(GUIGraphicsContext.Skin + @"\myMPlayer.xml");
+ initializeVirtualDirectory();
+ return bResult;
+ }
+
+ /// <summary>
+ /// Handler for the GUIMessage of the MP System
+ /// </summary>
+ /// <param name="message">Message of MP</param>
+ /// <returns>Result</returns>
+ public override bool OnMessage(GUIMessage message) {
+ if (message.Message == GUIMessage.MessageType.GUI_MSG_WINDOW_INIT) {
+ bool mplayerPlayerAvailable = false;
+ using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) {
+ mplayerPlayerAvailable = xmlreader.GetValueAsBool("plugins", "MPlayer", false);
}
- /// <summary>
- /// Handler for the GUIMessage of the MP System
- /// </summary>
- /// <param name="message">Message of MP</param>
- /// <returns>Result</returns>
- public override bool OnMessage(GUIMessage message) {
- if (message.Message == GUIMessage.MessageType.GUI_MSG_WINDOW_INIT) {
- bool mplayerPlayerAvailable = false;
- using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) {
- mplayerPlayerAvailable = xmlreader.GetValueAsBool("plugins", "MPlayer", false);
- }
-
- mplayerPlayerAvailable = (mplayerPlayerAvailable & System.IO.File.Exists(Config.GetFile(Config.Dir.Plugins, "ExternalPlayers", "MPlayer_ExtPlayer.dll")));
- if (!mplayerPlayerAvailable) {
- GUIDialogOK dlgOk = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK);
- dlgOk.SetHeading("My MPlayer GUI");
- dlgOk.SetLine(1, "MPlayer External Player not available!");
- dlgOk.SetLine(2, "Please activate it in the Setup");
- dlgOk.DoModal(GetID);
- GUIWindowManager.ShowPreviousWindow();
- }
- }
- return base.OnMessage(message);
+ mplayerPlayerAvailable = (mplayerPlayerAvailable & System.IO.File.Exists(Config.GetFile(Config.Dir.Plugins, "ExternalPlayers", "MPlayer_ExtPlayer.dll")));
+ if (!mplayerPlayerAvailable) {
+ GUIDialogOK dlgOk = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK);
+ dlgOk.SetHeading("My MPlayer GUI");
+ dlgOk.SetLine(1, "MPlayer External Player not available!");
+ dlgOk.SetLine(2, "Please activate it in the Setup");
+ dlgOk.DoModal(GetID);
+ GUIWindowManager.ShowPreviousWindow();
}
+ }
+ return base.OnMessage(message);
+ }
- /// <summary>
- /// Tries to start the playback of an disc
- /// </summary>
- /// <returns>true, if successful</returns>
- private bool OnPlayDisc() {
- String url = "";
- string[] drives = Environment.GetLogicalDrives();
- bool discFound = false;
- foreach (string driveElement in drives) {
- if (Utils.getDriveType(driveElement) == 5) {
- string driveLetter = driveElement.Substring(0, 1);
- if (System.IO.File.Exists(String.Format(@"{0}:\VIDEO_TS\VIDEO_TS.IFO", driveLetter))) {
- url = "dvd://" + driveLetter + ":.mplayer";
- discFound = true;
- break;
- } else if (System.IO.File.Exists(String.Format(@"{0}:\MPEGAV\AVSEQ01.DAT", driveLetter))) {
- url = "vcd://" + String.Format(@"{0}:\MPEGAV\AVSEQ01.DAT", driveLetter) + ".mplayer";
- discFound = true;
- break;
- } else if (System.IO.File.Exists(String.Format(@"{0}:\MPEG2\AVSEQ01.MPG", driveLetter))) {
- url = "svcd://" + String.Format(@"{0}:\MPEG2\AVSEQ01.MPG", driveLetter) + ".mplayer";
- discFound = true;
- break;
- } else if (System.IO.File.Exists(String.Format(@"{0}:\MPEG2\AVSEQ01.MPEG", driveLetter))) {
- url = "svcd://" + String.Format(@"{0}:\MPEG2\AVSEQ01.MPEG", driveLetter) + ".mplayer";
- discFound = true;
- break;
- }
+ /// <summary>
+ /// Tries to start the playback of an disc
+ /// </summary>
+ /// <returns>true, if successful</returns>
+ private bool OnPlayDisc() {
+ String url = "";
+ string[] drives = Environment.GetLogicalDrives();
+ bool discFound = false;
+ foreach (string driveElement in drives) {
+ if (Utils.getDriveType(driveElement) == 5) {
+ string driveLetter = driveElement.Substring(0, 1);
+ if (System.IO.File.Exists(String.Format(@"{0}:\VIDEO_TS\VIDEO_TS.IFO", driveLetter))) {
+ url = "dvd://" + driveLetter + ":.mplayer";
+ discFound = true;
+ break;
+ } else if (System.IO.File.Exists(String.Format(@"{0}:\MPEGAV\AVSEQ01.DAT", driveLetter))) {
+ url = "vcd://" + String.Format(@"{0}:\MPEGAV\AVSEQ01.DAT", driveLetter) + ".mplayer";
+ discFound = true;
+ break;
+ } else if (System.IO.File.Exists(String.Format(@"{0}:\MPEG2\AVSEQ01.MPG", driveLetter))) {
+ url = "svcd://" + String.Format(@"{0}:\MPEG2\AVSEQ01.MPG", driveLetter) + ".mplayer";
+ discFound = true;
+ break;
+ } else if (System.IO.File.Exists(String.Format(@"{0}:\MPEG2\AVSEQ01.MPEG", driveLetter))) {
+ url = "svcd://" + String.Format(@"{0}:\MPEG2\AVSEQ01.MPEG", driveLetter) + ".mplayer";
+ discFound = true;
+ break;
+ }
- }
- }
- if (discFound) {
- if (g_Player.Playing) {
- g_Player.Stop();
- }
- g_Player.Play(url);
- GUIGraphicsContext.IsFullScreenVideo = true;
- GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO);
- return true;
- }
- //no disc in drive...
- GUIDialogOK dlgOk = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK);
- dlgOk.SetHeading(3);//my videos
- dlgOk.SetLine(1, 219);//no disc
- dlgOk.DoModal(GetID);
- return false;
}
-
- /// <summary>
- /// Tries to start the playback of an internet stream
- /// </summary>
- /// <returns>true, if successful</returns>
- private bool OnPlayStream() {
- VirtualWebKeyboard keyboard = (VirtualWebKeyboard)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_VIRTUAL_WEB_KEYBOARD);
- if (null == keyboard) return false;
- keyboard.Reset();
- keyboard.Text = String.Empty;
- keyboard.DoModal(GUIWindowManager.ActiveWindow);
- if (keyboard.IsConfirmed) {
- if (!keyboard.Text.Equals(String.Empty)) {
- if (g_Player.Playing) {
- g_Player.Stop();
- }
- String url = keyboard.Text + ".mplayer";
- if (url.StartsWith("rtsp:")) {
- url = "ZZZZ:" + url.Remove(0, 5);
- }
-
- g_Player.Play(url);
- if (g_Player.Player != null && g_Player.IsVideo) {
- GUIGraphicsContext.IsFullScreenVideo = true;
- GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO);
- }
- }
- }
- return false;
+ }
+ if (discFound) {
+ if (g_Player.Playing) {
+ g_Player.Stop();
}
+ g_Player.Play(url);
+ GUIGraphicsContext.IsFullScreenVideo = true;
+ GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO);
+ return true;
+ }
+ //no disc in drive...
+ GUIDialogOK dlgOk = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK);
+ dlgOk.SetHeading(3);//my videos
+ dlgOk.SetLine(1, 219);//no disc
+ dlgOk.DoModal(GetID);
+ return false;
+ }
- /// <summary>
- /// Handles click events of GUI controls
- /// </summary>
- /// <param name="controlId">ID of the GUI control</param>
- /// <param name="control">Control Object</param>
- /// <param name="actionType">Performed ActionType</param>
- protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) {
- if (control == btnViewAs) {
- bool shouldContinue = false;
- do {
- shouldContinue = false;
- switch (CurrentView) {
- case View.List:
- CurrentView = View.Icons;
- if (facadeView.ThumbnailView == null)
- shouldContinue = true;
- else
- facadeView.View = GUIFacadeControl.ViewMode.SmallIcons;
- break;
- case View.Icons:
- CurrentView = View.LargeIcons;
- if (facadeView.ThumbnailView == null)
- shouldContinue = true;
- else
- facadeView.View = GUIFacadeControl.ViewMode.LargeIcons;
- break;
- case View.LargeIcons:
- CurrentView = View.FilmStrip;
- if (facadeView.FilmstripView == null)
- shouldContinue = true;
- else
- facadeView.View = GUIFacadeControl.ViewMode.Filmstrip;
- break;
- case View.FilmStrip:
- CurrentView = View.List;
- if (facadeView.ListView == null)
- shouldContinue = true;
- else
- facadeView.View = GUIFacadeControl.ViewMode.List;
- break;
- }
- } while (shouldContinue);
- SelectCurrentItem();
- GUIControl.FocusControl(GetID, controlId);
- return;
- }
+ /// <summary>
+ /// Tries to start the playback of an internet stream
+ /// </summary>
+ /// <returns>true, if successful</returns>
+ private bool OnPlayStream() {
+ VirtualKeyboard keyboard = (VirtualKeyboard)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_VIRTUAL_KEYBOARD);
+ if (null == keyboard) return false;
+ keyboard.Reset();
+ keyboard.Text = String.Empty;
+ keyboard.DoModal(GUIWindowManager.ActiveWindow);
+ if (keyboard.IsConfirmed) {
+ if (!keyboard.Text.Equals(String.Empty)) {
+ if (g_Player.Playing) {
+ g_Player.Stop();
+ }
+ String url = keyboard.Text + ".mplayer";
+ if (url.StartsWith("rtsp:")) {
+ url = "ZZZZ:" + url.Remove(0, 5);
+ }
- if (control == btnSortBy) {
- bool shouldContinue = false;
- do {
- shouldContinue = false;
- switch (CurrentSortMethod) {
- case VideoSort.SortMethod.Name:
- CurrentSortMethod = VideoSort.SortMethod.Date;
- break;
- case VideoSort.SortMethod.Date:
- CurrentSortMethod = VideoSort.SortMethod.Size;
- break;
- case VideoSort.SortMethod.Size:
- CurrentSortMethod = VideoSort.SortMethod.Name;
- break;
- }
- } while (shouldContinue);
- OnSort();
- GUIControl.FocusControl(GetID, control.GetID);
- }
- if (control == btnPlayDisc) {
- OnPlayDisc();
- return;
- }
- if (control == btnPlayStream) {
- OnPlayStream();
- return;
- }
- if (control == facadeView) {
- GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECTED, GetID, 0, controlId, 0, 0, null);
- OnMessage(msg);
- int iItem = (int)msg.Param1;
- if (actionType == Action.ActionType.ACTION_SHOW_INFO) {
- //OnInfo(iItem);
- facadeView.RefreshCoverArt();
- }
- if (actionType == Action.ActionType.ACTION_SELECT_ITEM) {
- OnClick();
- }
- if (actionType == Action.ActionType.ACTION_QUEUE_ITEM) {
- //OnQueueItem(iItem);
- }
- }
- if(control == btnDelete){
- OnAction(new Action(Action.ActionType.ACTION_DELETE_ITEM,0,0));
- }
+ g_Player.Play(url);
+ if (g_Player.Player != null && g_Player.IsVideo) {
+ GUIGraphicsContext.IsFullScreenVideo = true;
+ GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO);
+ }
}
+ }
+ return false;
+ }
- /// <summary>
- /// Handles the click in the facadeview
- /// </summary>
- private void OnClick() {
- GUIListItem item = facadeView.SelectedListItem;
- if (item == null) return;
- bool isFolderAMovie = false;
- string path = item.Path;
- if (item.IsFolder && !item.IsRemote) {
- // Check if folder is actually a DVD. If so don't browse this folder, but play the DVD!
- if ((System.IO.File.Exists(path + @"\VIDEO_TS\VIDEO_TS.IFO")) && (item.Label != "..")) {
- isFolderAMovie = true;
- path = "dvd://" + path;
- //path = item.Path + @"\VIDEO_TS\VIDEO_TS.IFO";
- } else if ((System.IO.File.Exists(path + @"\MPEGAV\AVSEQ01.DAT")) && (item.Label != "..")) {
- isFolderAMovie = true;
- path = "vcd://" + String.Format(@"{0}\MPEGAV\AVSEQ01.DAT", item.Path);
- } else if ((System.IO.File.Exists(path + @"\MPEG2\AVSEQ01.MPG")) && (item.Label != "..")) {
- isFolderAMovie = true;
- path = "svcd://" + String.Format(@"{0}\MPEG2\AVSEQ01.MPG", item.Path);
- } else if ((System.IO.File.Exists(path + @"\MPEG2\AVSEQ01.MPEG")) && (item.Label != "..")) {
- isFolderAMovie = true;
- path = "svcd://" + String.Format(@"{0}\MPEG2\AVSEQ01.MPEG", item.Path);
- } else {
- isFolderAMovie = false;
- }
- }
+ /// <summary>
+ /// Handles click events of GUI controls
+ /// </summary>
+ /// <param name="controlId">ID of the GUI control</param>
+ /// <param name="control">Control Object</param>
+ /// <param name="actionType">Performed ActionType</param>
+ protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) {
+ if (control == btnViewAs) {
+ bool shouldContinue = false;
+ do {
+ shouldContinue = false;
+ switch (CurrentView) {
+ case View.List:
+ CurrentView = View.Icons;
+ if (facadeView.ThumbnailView == null)
+ shouldContinue = true;
+ else
+ facadeView.View = GUIFacadeControl.ViewMode.SmallIcons;
+ break;
+ case View.Icons:
+ CurrentView = View.LargeIcons;
+ if (facadeView.ThumbnailView == null)
+ shouldContinue = true;
+ else
+ facadeView.View = GUIFacadeControl.ViewMode.LargeIcons;
+ break;
+ case View.LargeIcons:
+ CurrentView = View.FilmStrip;
+ if (facadeView.FilmstripView == null)
+ shouldContinue = true;
+ else
+ facadeView.View = GUIFacadeControl.ViewMode.Filmstrip;
+ break;
+ case View.FilmStrip:
+ CurrentView = View.List;
+ if (facadeView.ListView == null)
+ shouldContinue = true;
+ else
+ facadeView.View = GUIFacadeControl.ViewMode.List;
+ break;
+ }
+ } while (shouldContinue);
+ SelectCurrentItem();
+ GUIControl.FocusControl(GetID, controlId);
+ return;
+ }
- if ((item.IsFolder) && (!isFolderAMovie)) {
- //currentSelectedItem = -1;
- virtualPath = path;
- LoadDirectory(path);
- } else {
- string movieFileName = path + ".mplayer";
- if (movieFileName.StartsWith("rtsp:")) {
- movieFileName = "ZZZZ:" + movieFileName.Remove(0, 5);
- }
- movieFileName = m_directory.GetLocalFilename(movieFileName);
- if (PlayListFactory.IsPlayList(movieFileName)) {
- LoadPlayList(movieFileName);
- return;
- }
- g_Player.Play(movieFileName);
- if (g_Player.IsVideo) {
- GUIGraphicsContext.IsFullScreenVideo = true;
- GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO);
- }
- return;
- }
+ if (control == btnSortBy) {
+ bool shouldContinue = false;
+ do {
+ shouldContinue = false;
+ switch (CurrentSortMethod) {
+ case VideoSort.SortMethod.Name:
+ CurrentSortMethod = VideoSort.SortMethod.Date;
+ break;
+ case VideoSort.SortMethod.Date:
+ CurrentSortMethod = VideoSort.SortMethod.Size;
+ break;
+ case VideoSort.SortMethod.Size:
+ CurrentSortMethod = VideoSort.SortMethod.Name;
+ break;
+ }
+ } while (shouldContinue);
+ OnSort();
+ GUIControl.FocusControl(GetID, control.GetID);
+ }
+ if (control == btnPlayDisc) {
+ OnPlayDisc();
+ return;
+ }
+ if (control == btnPlayStream) {
+ OnPlayStream();
+ return;
+ }
+ if (control == facadeView) {
+ GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECTED, GetID, 0, controlId, 0, 0, null);
+ OnMessage(msg);
+ int iItem = (int)msg.Param1;
+ if (actionType == Action.ActionType.ACTION_SHOW_INFO) {
+ //OnInfo(iItem);
+ facadeView.RefreshCoverArt();
}
+ if (actionType == Action.ActionType.ACTION_SELECT_ITEM) {
+ OnClick();
+ }
+ if (actionType == Action.ActionType.ACTION_QUEUE_ITEM) {
+ //OnQueueItem(iItem);
+ }
+ }
+ if (control == btnDelete) {
+ OnAction(new Action(Action.ActionType.ACTION_DELETE_ITEM, 0, 0));
+ }
+ }
- /// <summary>
- /// Selects the current selected Item of the facadeView
- /// </summary>
- private void SelectCurrentItem() {
- int iItem = facadeView.SelectedListItemIndex;
- if (iItem > -1) {
- GUIControl.SelectItemControl(GetID, facadeView.GetID, iItem);
- }
- UpdateButtonStates();
+ /// <summary>
+ /// Handles the click in the facadeview
+ /// </summary>
+ private void OnClick() {
+ GUIListItem item = facadeView.SelectedListItem;
+ if (item == null) return;
+ bool isFolderAMovie = false;
+ string path = item.Path;
+ if (item.IsFolder && !item.IsRemote) {
+ // Check if folder is actually a DVD. If so don't browse this folder, but play the DVD!
+ if ((System.IO.File.Exists(path + @"\VIDEO_TS\VIDEO_TS.IFO")) && (item.Label != "..")) {
+ isFolderAMovie = true;
+ path = "dvd://" + path;
+ //path = item.Path + @"\VIDEO_TS\VIDEO_TS.IFO";
+ } else if ((System.IO.File.Exists(path + @"\MPEGAV\AVSEQ01.DAT")) && (item.Label != "..")) {
+ isFolderAMovie = true;
+ path = "vcd://" + String.Format(@"{0}\MPEGAV\AVSEQ01.DAT", item.Path);
+ } else if ((System.IO.File.Exists(path + @"\MPEG2\AVSEQ01.MPG")) && (item.Label != "..")) {
+ isFolderAMovie = true;
+ path = "svcd://" + String.Format(@"{0}\MPEG2\AVSEQ01.MPG", item.Path);
+ } else if ((System.IO.File.Exists(path + @"\MPEG2\AVSEQ01.MPEG")) && (item.Label != "..")) {
+ isFolderAMovie = true;
+ path = "svcd://" + String.Format(@"{0}\MPEG2\AVSEQ01.MPEG", item.Path);
+ } else {
+ isFolderAMovie = false;
}
+ }
- /// <summary>
- /// Sorts the facadeView
- /// </summary>
- protected virtual void OnSort() {
- facadeView.Sort(new VideoSort(CurrentSortMethod, CurrentSortAsc));
- UpdateButtonStates();
+ if ((item.IsFolder) && (!isFolderAMovie)) {
+ //currentSelectedItem = -1;
+ virtualPath = path;
+ LoadDirectory(path);
+ } else {
+ string movieFileName = path + ".mplayer";
+ if (movieFileName.StartsWith("rtsp:")) {
+ movieFileName = "ZZZZ:" + movieFileName.Remove(0, 5);
}
+ movieFileName = m_directory.GetLocalFilename(movieFileName);
+ if (PlayListFactory.IsPlayList(movieFileName)) {
+ LoadPlayList(movieFileName);
+ return;
+ }
+ g_Player.Play(movieFileName);
+ if (g_Player.IsVideo) {
+ GUIGraphicsContext.IsFullScreenVideo = true;
+ GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO);
+ }
+ return;
+ }
+ }
- /// <summary>
- /// Updates the labels of the button
- /// </summary>
- protected virtual void UpdateButtonStates() {
- GUIControl.HideControl(GetID, facadeView.GetID);
+ /// <summary>
+ /// Selects the current selected Item of the facadeView
+ /// </summary>
+ private void SelectCurrentItem() {
+ int iItem = facadeView.SelectedListItemIndex;
+ if (iItem > -1) {
+ GUIControl.SelectItemControl(GetID, facadeView.GetID, iItem);
+ }
+ UpdateButtonStates();
+ }
- int iControl = facadeView.GetID;
- GUIControl.ShowControl(GetID, iControl);
- GUIControl.FocusControl(GetID, iControl);
- string strLine = String.Empty;
- View view = CurrentView;
- switch (view) {
- case View.List:
- strLine = GUILocalizeStrings.Get(101);
- break;
- case View.Icons:
- strLine = GUILocalizeStrings.Get(100);
- break;
- case View.LargeIcons:
- strLine = GUILocalizeStrings.Get(417);
- break;
- case View.FilmStrip:
- strLine = GUILocalizeStrings.Get(733);
- break;
- }
- GUIControl.SetControlLabel(GetID, btnViewAs.GetID, strLine);
+ /// <summary>
+ /// Sorts the facadeView
+ /// </summary>
+ protected virtual void OnSort() {
+ facadeView.Sort(new VideoSort(CurrentSortMethod, CurrentSortAsc));
+ UpdateButtonStates();
+ }
- switch (CurrentSortMethod) {
- case VideoSort.SortMethod.Name:
- strLine = GUILocalizeStrings.Get(365);
- break;
- case VideoSort.SortMethod.Date:
- strLine = GUILocalizeStrings.Get(104);
- break;
- case VideoSort.SortMethod.Size:
- strLine = GUILocalizeStrings.Get(105);
- break;
- }
+ /// <summary>
+ /// Updates the labels of the button
+ /// </summary>
+ protected virtual void UpdateButtonStates() {
+ GUIControl.HideControl(GetID, facadeView.GetID);
- if (btnSortBy != null) {
- btnSortBy.Label = strLine;
- btnSortBy.IsAscending = CurrentSortAsc;
- }
- }
+ int iControl = facadeView.GetID;
+ GUIControl.ShowControl(GetID, iControl);
+ GUIControl.FocusControl(GetID, iControl);
+ string strLine = String.Empty;
+ View view = CurrentView;
+ switch (view) {
+ case View.List:
+ strLine = GUILocalizeStrings.Get(101);
+ break;
+ case View.Icons:
+ strLine = GUILocalizeStrings.Get(100);
+ break;
+ case View.LargeIcons:
+ strLine = GUILocalizeStrings.Get(417);
+ break;
+ case View.FilmStrip:
+ strLine = GUILocalizeStrings.Get(733);
+ break;
+ }
+ GUIControl.SetControlLabel(GetID, btnViewAs.GetID, strLine);
- /// <summary>
- /// Handles the page load event and initializes the plugin
- /// </summary>
- protected override void OnPageLoad() {
- GUIVideoOverlay videoOverlay = (GUIVideoOverlay)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_VIDEO_OVERLAY);
- if ((videoOverlay != null) && (videoOverlay.Focused)) videoOverlay.Focused = false;
+ switch (CurrentSortMethod) {
+ case VideoSort.SortMethod.Name:
+ strLine = GUILocalizeStrings.Get(365);
+ break;
+ case VideoSort.SortMethod.Date:
+ strLine = GUILocalizeStrings.Get(104);
+ break;
+ case VideoSort.SortMethod.Size:
+ strLine = GUILocalizeStrings.Get(105);
+ break;
+ }
- LoadDirectory(virtualPath);
- if (btnSortBy != null) {
- btnSortBy.SortChanged += new SortEventHandler(SortChanged);
- }
- CurrentSortAsc = true;
- OnSort();
- }
+ if (btnSortBy != null) {
+ btnSortBy.Label = strLine;
+ btnSortBy.IsAscending = CurrentSortAsc;
+ }
+ }
- /// <summary>
- /// Reads all extensions from external player plugin
- /// </summary>
- /// <returns>Lsit of all extensions</returns>
- private ArrayList getExtenstions() {
- ArrayList extensions = new ArrayList();
- XmlDocument doc = new XmlDocument();
- string path = Config.GetFile(Config.Dir.Config, "MPlayer_ExtPlayer.xml");
- doc.Load(path);
- XmlNodeList listExtensions = doc.DocumentElement.SelectNodes("/mplayer/extensions/Extension");
- foreach (XmlNode nodeExtension in listExtensions) {
- extensions.Add(nodeExtension.Attributes["name"].Value);
- }
- return extensions;
- }
+ /// <summary>
+ /// Handles the page load event and initializes the plugin
+ /// </summary>
+ protected override void OnPageLoad() {
+ GUIVideoOverlay videoOverlay = (GUIVideoOverlay)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_VIDEO_OVERLAY);
+ if ((videoOverlay != null) && (videoOverlay.Focused)) videoOverlay.Focused = false;
- /// <summary>
- /// Loads a playlist and starts the playback
- /// </summary>
- /// <param name="playListFileName">Filename of the playlist</param>
- private void LoadPlayList(string playListFileName) {
- IPlayListIO loader = PlayListFactory.CreateIO(playListFileName);
- PlayList playlist = new PlayList();
+ LoadDirectory(virtualPath);
+ if (btnSortBy != null) {
+ btnSortBy.SortChanged += new SortEventHandler(SortChanged);
+ }
+ CurrentSortAsc = true;
+ OnSort();
+ }
- if (!loader.Load(playlist, playListFileName)) {
- GUIDialogOK dlgOK = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK);
- if (dlgOK != null) {
- dlgOK.SetHeading(6);
- dlgOK.SetLine(1, 477);
- dlgOK.SetLine(2, String.Empty);
- dlgOK.DoModal(GetID);
- }
- return;
- }
+ /// <summary>
+ /// Reads all extensions from external player plugin
+ /// </summary>
+ /// <returns>Lsit of all extensions</returns>
+ private ArrayList getExtenstions() {
+ ArrayList extensions = new ArrayList();
+ XmlDocument doc = new XmlDocument();
+ string path = Config.GetFile(Config.Dir.Config, "MPlayer_ExtPlayer.xml");
+ doc.Load(path);
+ XmlNodeList listExtensions = doc.DocumentElement.SelectNodes("/mplayer/extensions/Extension");
+ foreach (XmlNode nodeExtension in listExtensions) {
+ extensions.Add(nodeExtension.Attributes["name"].Value);
+ }
+ return extensions;
+ }
- if (playlist.Count == 1) {
- if (g_Player.Play(playlist[0].FileName + ".mplayer")) {
- if (MediaPortal.Util.Utils.IsVideo(playlist[0].FileName)) {
- GUIGraphicsContext.IsFullScreenVideo = true;
- GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO);
- }
- }
- return;
- }
+ /// <summary>
+ /// Loads a playlist and starts the playback
+ /// </summary>
+ /// <param name="playListFileName">Filename of the playlist</param>
+ private void LoadPlayList(string playListFileName) {
+ IPlayListIO loader = PlayListFactory.CreateIO(playListFileName);
+ PlayList playlist = new PlayList();
- playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_VIDEO).Clear();
+ if (!loader.Load(playlist, playListFileName)) {
+ GUIDialogOK dlgOK = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK);
+ if (dlgOK != null) {
+ dlgOK.SetHeading(6);
+ dlgOK.SetLine(1, 477);
+ dlgOK.SetLine(2, String.Empty);
+ dlgOK.DoModal(GetID);
+ }
+ return;
+ }
- for (int i = 0; i < playlist.Count; ++i) {
- playlist[i].FileName += ".mplayer";
- PlayListItem playListItem = playlist[i];
- playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_VIDEO).Add(playListItem);
- }
+ if (playlist.Count == 1) {
+ if (g_Player.Play(playlist[0].FileName + ".mplayer")) {
+ if (MediaPortal.Util.Utils.IsVideo(playlist[0].FileName)) {
+ GUIGraphicsContext.IsFullScreenVideo = true;
+ GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO);
+ }
+ }
+ return;
+ }
+ playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_VIDEO).Clear();
- if (playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_VIDEO).Count > 0) {
- playlist = playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_VIDEO);
- PlayListItem item = playlist[0];
+ for (int i = 0; i < playlist.Count; ++i) {
+ playlist[i].FileName += ".mplayer";
+ PlayListItem playListItem = playlist[i];
+ playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_VIDEO).Add(playListItem);
+ }
- playlistPlayer.CurrentPlaylistType = PlayListType.PLAYLIST_VIDEO;
- playlistPlayer.Reset();
- playlistPlayer.Play(0);
- if (GetID == GUIWindowManager.ActiveWindow) {
- GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_VIDEO_PLAYLIST);
- }
- }
- }
+ if (playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_VIDEO).Count > 0) {
+ playlist = playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_VIDEO);
+ PlayListItem item = playlist[0];
- /// <summary>
- /// Loads a new Directory
- /// </summary>
- /// <param name="newFolderName">Name of the folder</param>
- private void LoadDirectory(string newFolderName) {
- String _currentFolder = newFolderName;
+ playlistPlayer.CurrentPlaylistType = PlayListType.PLAYLIST_VIDEO;
+ playlistPlayer.Reset();
+ playlistPlayer.Play(0);
- string objectCount = String.Empty;
- ArrayList itemlist = new ArrayList();
- GUIControl.ClearControl(GetID, facadeView.GetID);
- itemlist = m_directory.GetDirectory(_currentFolder);
- ArrayList itemfiltered = new ArrayList();
- for (int x = 0; x < itemlist.Count; ++x) {
- bool addItem = true;
- GUIListItem item1 = (GUIListItem)itemlist[x];
- for (int y = 0; y < itemlist.Count; ++y) {
- GUIListItem item2 = (GUIListItem)itemlist[y];
- if (x != y) {
- if (!item1.IsFolder || !item2.IsFolder) {
- if (!item1.IsRemote && !item2.IsRemote) {
- if (MediaPortal.Util.Utils.ShouldStack(item1.Path, item2.Path)) {
- if (String.Compare(item1.Path, item2.Path, true) > 0) {
- addItem = false;
- // Update to reflect the stacked size
- item2.FileInfo.Length += item1.FileInfo.Length;
- }
- }
- }
- }
- }
- }
+ if (GetID == GUIWindowManager.ActiveWindow) {
+ GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_VIDEO_PLAYLIST);
+ }
+ }
+ }
- if (addItem) {
- string label = item1.Label;
+ /// <summary>
+ /// Loads a new Directory
+ /// </summary>
+ /// <param name="newFolderName">Name of the folder</param>
+ private void LoadDirectory(string newFolderName) {
+ String _currentFolder = newFolderName;
- MediaPortal.Util.Utils.RemoveStackEndings(ref label);
- item1.Label = label;
- itemfiltered.Add(item1);
+ string objectCount = String.Empty;
+ ArrayList itemlist = new ArrayList();
+ GUIControl.ClearControl(GetID, facadeView.GetID);
+ itemlist = m_directory.GetDirectory(_currentFolder);
+ ArrayList itemfiltered = new ArrayList();
+ for (int x = 0; x < itemlist.Count; ++x) {
+ bool addItem = true;
+ GUIListItem item1 = (GUIListItem)itemlist[x];
+ for (int y = 0; y < itemlist.Count; ++y) {
+ GUIListItem item2 = (GUIListItem)itemlist[y];
+ if (x != y) {
+ if (!item1.IsFolder || !item2.IsFolder) {
+ if (!item1.IsRemote && !item2.IsRemote) {
+ if (MediaPortal.Util.Utils.ShouldStack(item1.Path, item2.Path)) {
+ if (String.Compare(item1.Path, item2.Path, true) > 0) {
+ addItem = false;
+ // Update to reflect the stacked size
+ item2.FileInfo.Length += item1.FileInfo.Length;
+ }
}
+ }
}
- itemlist = itemfiltered;
+ }
+ }
- foreach (GUIListItem item in itemlist) {
- facadeView.Add(item);
- }
- OnSort();
+ if (addItem) {
+ string label = item1.Label;
+
+ MediaPortal.Util.Utils.RemoveStackEndings(ref label);
+ item1.Label = label;
+ itemfiltered.Add(item1);
}
- /// <summary>
- /// Overrides on action for deleting item
- /// </summary>
- /// <param name="action"></param>
- public override void OnAction(Action action) {
- if (action.wID == Action.ActionType.ACTION_DELETE_ITEM) {
- GUIListItem item = facadeView.SelectedListItem;
- if (item != null) {
- if (!item.IsFolder) {
- OnDeleteItem(item);
- return;
- }
- }
- }
- base.OnAction(action);
- }
- /// <summary>
- /// Handles the event, when the Sorting method changes
- /// </summary>
- /// <param name="sender">Sender object</param>
- /// <param name="e">Event arguments</param>
- private void SortChanged(object sender, SortEventArgs e) {
- CurrentSortAsc = e.Order != System.Windows.Forms.SortOrder.Descending;
+ }
+ itemlist = itemfiltered;
- OnSort();
- GUIControl.FocusControl(GetID, ((GUIControl)sender).GetID);
+ foreach (GUIListItem item in itemlist) {
+ facadeView.Add(item);
+ }
+ OnSort();
+ }
+ /// <summary>
+ /// Overrides on action for deleting item
+ /// </summary>
+ /// <param name="action"></param>
+ public override void OnAction(Action action) {
+ if (action.wID == Action.ActionType.ACTION_DELETE_ITEM) {
+ GUIListItem item = facadeView.SelectedListItem;
+ if (item != null) {
+ if (!item.IsFolder) {
+ OnDeleteItem(item);
+ return;
+ }
}
+ }
+ base.OnAction(action);
+ }
+ /// <summary>
+ /// Handles the event, when the Sorting method changes
+ /// </summary>
+ /// <param name="sender">Sender object</param>
+ /// <param name="e">Event arguments</param>
+ private void SortChanged(object sender, SortEventArgs e) {
+ CurrentSortAsc = e.Order != System.Windows.Forms.SortOrder.Descending;
- /// <summary>
- /// Deletes an item from the gui list
- /// </summary>
- /// <param name="item">item to delete</param>
- private void OnDeleteItem(GUIListItem item) {
- if (item.IsRemote) return;
- if (!m_directory.RequestPin(item.Path)) {
- return;
- }
+ OnSort();
+ GUIControl.FocusControl(GetID, ((GUIControl)sender).GetID);
+ }
- string movieFileName = System.IO.Path.GetFileName(item.Path);
- string movieTitle = movieFileName;
- // delete single file
- GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO);
- if (null == dlgYesNo) return;
- dlgYesNo.SetHeading(GUILocalizeStrings.Get(925));
- dlgYesNo.SetLine(1, movieTitle);
- dlgYesNo.SetLine(2, String.Empty);
- dlgYesNo.SetLine(3, String.Empty);
- dlgYesNo.DoModal(GetID);
+ /// <summary>
+ /// Deletes an item from the gui list
+ /// </summary>
+ /// <param name="item">item to delete</param>
+ private void OnDeleteItem(GUIListItem item) {
+ if (item.IsRemote) return;
+ if (!m_directory.RequestPin(item.Path)) {
+ return;
+ }
- if (!dlgYesNo.IsConfirmed)
- return;
- DoDeleteItem(item);
+ string movieFileName = System.IO.Path.GetFileName(item.Path);
+ string movieTitle = movieFileName;
+ // delete single file
+ GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO);
+ if (null == dlgYesNo) return;
+ dlgYesNo.SetHeading(GUILocalizeStrings.Get(925));
+ dlgYesNo.SetLine(1, movieTitle);
+ dlgYesNo.SetLine(2, String.Empty);
+ dlgYesNo.SetLine(3, String.Empty);
+ dlgYesNo.DoModal(GetID);
- int currentSelectedItem = facadeView.SelectedListItemIndex;
- if (currentSelectedItem > 0) currentSelectedItem--;
- LoadDirectory(virtualPath);
- if (currentSelectedItem >= 0) {
- GUIControl.SelectItemControl(GetID, facadeView.GetID, currentSelectedItem);
- }
+ if (!dlgYesNo.IsConfirmed)
+ return;
+ DoDeleteItem(item);
+
+ int currentSelectedItem = facadeView.SelectedListItemIndex;
+ if (currentSelectedItem > 0) currentSelectedItem--;
+ LoadDirectory(virtualPath);
+ if (currentSelectedItem >= 0) {
+ GUIControl.SelectItemControl(GetID, facadeView.GetID, currentSelectedItem);
+ }
+ }
+ /// <summary>
+ /// Deletes the item
+ /// </summary>
+ /// <param name="item">Item to delete</param>
+ private void DoDeleteItem(GUIListItem item) {
+ if (item.IsFolder) {
+ if (item.IsRemote) return;
+ if (item.Label != "..") {
+ ArrayList items = new ArrayList();
+ items = m_directory.GetDirectoryUnProtected(item.Path, false);
+ foreach (GUIListItem subItem in items) {
+ DoDeleteItem(subItem);
+ }
+ MediaPortal.Util.Utils.DirectoryDelete(item.Path);
}
- /// <summary>
- /// Deletes the item
- /// </summary>
- /// <param name="item">Item to delete</param>
- private void DoDeleteItem(GUIListItem item) {
- if (item.IsFolder) {
- if (item.IsRemote) return;
- if (item.Label != "..") {
- ArrayList items = new ArrayList();
- items = m_directory.GetDirectoryUnProtected(item.Path, false);
- foreach (GUIListItem subItem in items) {
- DoDeleteItem(subItem);
- }
- MediaPortal.Util.Utils.DirectoryDelete(item.Path);
- }
- } else {
- if (item.IsRemote) return;
- MediaPortal.Util.Utils.FileDelete(item.Path);
- }
- }
+ } else {
+ if (item.IsRemote) return;
+ MediaPortal.Util.Utils.FileDelete(item.Path);
+ }
+ }
- /// <summary>
- /// Initialize the virtual directory
- /// </summary>
- private void initializeVirtualDirectory() {
- sharePaths = new List<string>();
- m_directory.SetExtensions(getExtenstions());
- m_directory.Clear();
- if (useMyVideoShares) {
- AddSection("movies");
- }
- if (useMyMusicShares) {
- AddSection("music");
- }
- Share share = null;
- XmlDocument doc = new XmlDocument();
- string path = Config.GetFile(Config.Dir.Config, "MPlayer_GUIPlugin.xml");
- doc.Load(path);
- XmlNodeList listShare = doc.DocumentElement.SelectNodes("/mplayergui/Share");
- foreach (XmlNode nodeShare in listShare) {
- share = new Share();
- share.Name = nodeShare.Attributes["name"].Value;
- share.Path = nodeShare.Attributes["path"].Value;
- if (!sharePaths.Contains(share.Path.ToLower())) {
- sharePaths.Add(share.Path.ToLower());
- m_directory.Add(share);
- }
- }
+ /// <summary>
+ /// Initialize the virtual directory
+ /// </summary>
+ private void initializeVirtualDirectory() {
+ sharePaths = new List<string>();
+ m_directory.SetExtensions(getExtenstions());
+ m_directory.Clear();
+ if (useMyVideoShares) {
+ AddSection("movies");
+ }
+ if (useMyMusicShares) {
+ AddSection("music");
+ }
+ Share share = null;
+ XmlDocument doc = new XmlDocument();
+ string path = Config.GetFile(Config.Dir.Config, "MPlayer_GUIPlugin.xml");
+ doc.Load(path);
+ XmlNodeList listShare = doc.DocumentElement.SelectNodes("/mplayergui/Share");
+ foreach (XmlNode nodeShare in listShare) {
+ share = new Share();
+ share.Name = nodeShare.Attributes["name"].Value;
+ share.Path = nodeShare.Attributes["path"].Value;
+ if (!sharePaths.Contains(share.Path.ToLower())) {
+ sharePaths.Add(share.Path.ToLower());
+ m_directory.Add(share);
}
+ }
+ }
- /// <summary>
- /// Adds a section of MP shares
- /// </summary>
- /// <param name="section">Name of the section</param>
- private void AddSection(String section) {
- Share defaultshare = null;
- using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) {
- string strDefault = xmlreader.GetValueAsString(section, "default", String.Empty);
- for (int i = 0; i < 20; i++) {
- string strShareName = String.Format("sharename{0}", i);
- string strSharePath = String.Format("sharepath{0}", i);
- string strPincode = String.Format("pincode{0}", i);
+ /// <summary>
+ /// Adds a section of MP shares
+ /// </summary>
+ /// <param name="section">Name of the section</param>
+ private void AddSection(String section) {
+ Share defaultshare = null;
+ using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) {
+ string strDefault = xmlreader.GetValueAsString(section, "default", String.Empty);
+ for (int i = 0; i < 20; i++) {
+ string strShareName = String.Format("sharename{0}", i);
+ string strSharePath = String.Format("sharepath{0}", i);
+ string strPincode = String.Format("pincode{0}", i);
- string shareType = String.Format("sharetype{0}", i);
- string shareServer = String.Format("shareserver{0}", i);
- string shareLogin = String.Format("sharelogin{0}", i);
- string sharePwd = String.Format("sharepassword{0}", i);
- string sharePort = String.Format("shareport{0}", i);
- string remoteFolder = String.Format("shareremotepath{0}", i);
- string shareViewPath = String.Format("shareview{0}", i);
+ string shareType = String.Format("sharetype{0}", i);
+ string shareServer = String.Format("shareserver{0}", i);
+ string shareLogin = String.Format("sharelogin{0}", i);
+ string sharePwd = String.Format("sharepassword{0}", i);
+ string sharePort = String.Format("shareport{0}", i);
+ string remoteFolder = String.Format("shareremotepath{0}", i);
+ string shareViewPath = String.Format("shareview{0}", i);
- Share share = new Share();
- share.Name = xmlreader.GetValueAsString(section, strShareName, String.Empty);
- share.Path = xmlreader.GetValueAsString(section, strSharePath, String.Empty);
+ Share share = new Share();
+ share.Name = xmlreader.GetValueAsString(section, strShareName, String.Empty);
+ share.Path = xmlreader.GetValueAsString(section, strSharePath, String.Empty);
- string pinCode = MediaPortal.Util.Utils.DecryptPin(xmlreader.GetValueAsString(section, strPincode, string.Empty));
- if (pinCode != string.Empty)
- share.Pincode = Convert.ToInt32(pinCode);
- else
- share.Pincode = -1;
+ string pinCode = MediaPortal.Util.Utils.DecryptPin(xmlreader.GetValueAsString(section, strPincode, string.Empty));
+ if (pinCode != string.Empty)
+ share.Pincode = Convert.ToInt32(pinCode);
+ else
+ share.Pincode = -1;
- share.IsFtpShare = xmlreader.GetValueAsBool(section, shareType, false);
- share.FtpServer = xmlreader.GetValueAsString(section, shareServer, String.Empty);
- share.FtpLoginName = xmlreader.GetValueAsString(section, shareLogin, String.Empty);
- share.FtpPassword = xmlreader.GetValueAsString(section, sharePwd, String.Empty);
- share.FtpPort = xmlreader.GetValueAsInt(section, sharePort, 21);
- share.FtpFolder = xmlreader.GetValueAsString(section, remoteFolder, "/");
- share.DefaultView = (Share.Views)xmlreader.GetValueAsInt(section, shareViewPath, (int)Share.Views.List);
+ share.IsFtpShare = xmlreader.GetValueAsBool(section, shareType, false);
+ share.FtpServer = xmlreader.GetValueAsString(section, shareServer, String.Empty);
+ share.FtpLoginName = xmlreader.GetValueAsString(section, shareLogin, String.Empty);
+ share.FtpPassword = xmlreader.GetValueAsString(section, sharePwd, String.Empty);
+ share.FtpPort = xmlreader.GetValueAsInt(section, sharePort, 21);
+ share.FtpFolder = xmlreader.GetValueAsString(section, remoteFolder, "/");
+ share.DefaultView = (Share.Views)xmlreader.GetValueAsInt(section, shareViewPath, (int)Share.Views.List);
- if (share.Name.Length > 0) {
+ if (share.Name.Length > 0) {
- if (strDefault == share.Name) {
- share.Default = true;
- if (defaultshare == null) {
- defaultshare = share;
- }
- ...
[truncated message content] |
|
From: <du...@us...> - 2007-04-11 19:10:23
|
Revision: 313
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=313&view=rev
Author: dukus
Date: 2007-04-11 12:10:20 -0700 (Wed, 11 Apr 2007)
Log Message:
-----------
Added full skin package support
Modified Paths:
--------------
trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs
trunk/plugins/mpinstaler/MPInstaler/Form1.cs
trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs
trunk/plugins/mpinstaler/MPInstaler/MPpackageStruct.cs
trunk/plugins/mpinstaler/MPInstaler/download_form.Designer.cs
trunk/plugins/mpinstaler/MPInstaler/download_form.cs
Modified: trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs 2007-04-10 12:11:44 UTC (rev 312)
+++ trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs 2007-04-11 19:10:20 UTC (rev 313)
@@ -51,12 +51,13 @@
this.skinToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.componentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mediaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.fullToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.languageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.textToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.textToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.otherToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.customizationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.postSetupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.bossview = new System.Windows.Forms.ListView();
this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
@@ -104,8 +105,9 @@
this.openToolStripButton = new System.Windows.Forms.ToolStripButton();
this.saveToolStripButton = new System.Windows.Forms.ToolStripButton();
this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
- this.customizationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.postSetupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.soundsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.animationsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.tetrisToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.tabPage_Skin.SuspendLayout();
@@ -231,7 +233,7 @@
this.tagReadersToolStripMenuItem,
this.externalPlayersToolStripMenuItem});
this.windowPluginToolStripMenuItem.Name = "windowPluginToolStripMenuItem";
- this.windowPluginToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
+ this.windowPluginToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.windowPluginToolStripMenuItem.Text = "Plugin";
//
// windowToolStripMenuItem
@@ -274,44 +276,38 @@
this.skinToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.componentToolStripMenuItem,
this.mediaToolStripMenuItem,
- this.fullToolStripMenuItem});
+ this.soundsToolStripMenuItem,
+ this.animationsToolStripMenuItem,
+ this.tetrisToolStripMenuItem});
this.skinToolStripMenuItem.Name = "skinToolStripMenuItem";
- this.skinToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
+ this.skinToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.skinToolStripMenuItem.Text = "Skin";
//
// componentToolStripMenuItem
//
this.componentToolStripMenuItem.Name = "componentToolStripMenuItem";
- this.componentToolStripMenuItem.Size = new System.Drawing.Size(140, 22);
+ this.componentToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.componentToolStripMenuItem.Text = "Component";
this.componentToolStripMenuItem.Click += new System.EventHandler(this.componentToolStripMenuItem_Click);
//
// mediaToolStripMenuItem
//
this.mediaToolStripMenuItem.Name = "mediaToolStripMenuItem";
- this.mediaToolStripMenuItem.Size = new System.Drawing.Size(140, 22);
+ this.mediaToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.mediaToolStripMenuItem.Text = "Media";
this.mediaToolStripMenuItem.Click += new System.EventHandler(this.mediaToolStripMenuItem_Click);
//
- // fullToolStripMenuItem
- //
- this.fullToolStripMenuItem.Enabled = false;
- this.fullToolStripMenuItem.Name = "fullToolStripMenuItem";
- this.fullToolStripMenuItem.Size = new System.Drawing.Size(140, 22);
- this.fullToolStripMenuItem.Text = "Full";
- this.fullToolStripMenuItem.Visible = false;
- //
// languageToolStripMenuItem
//
this.languageToolStripMenuItem.Name = "languageToolStripMenuItem";
- this.languageToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
+ this.languageToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.languageToolStripMenuItem.Text = "Language";
this.languageToolStripMenuItem.Click += new System.EventHandler(this.languageToolStripMenuItem_Click);
//
// textToolStripMenuItem
//
this.textToolStripMenuItem.Name = "textToolStripMenuItem";
- this.textToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
+ this.textToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.textToolStripMenuItem.Text = "Text";
this.textToolStripMenuItem.Click += new System.EventHandler(this.textToolStripMenuItem_Click);
//
@@ -319,23 +315,38 @@
//
this.settingsToolStripMenuItem.Enabled = false;
this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
- this.settingsToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
+ this.settingsToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.settingsToolStripMenuItem.Text = "Settings";
//
// textToolStripMenuItem1
//
this.textToolStripMenuItem1.Name = "textToolStripMenuItem1";
- this.textToolStripMenuItem1.Size = new System.Drawing.Size(132, 22);
+ this.textToolStripMenuItem1.Size = new System.Drawing.Size(152, 22);
this.textToolStripMenuItem1.Text = "Thumbs";
this.textToolStripMenuItem1.Click += new System.EventHandler(this.textToolStripMenuItem1_Click);
//
// otherToolStripMenuItem
//
this.otherToolStripMenuItem.Name = "otherToolStripMenuItem";
- this.otherToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
+ this.otherToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.otherToolStripMenuItem.Text = "Other";
this.otherToolStripMenuItem.Click += new System.EventHandler(this.otherToolStripMenuItem_Click);
//
+ // customizationToolStripMenuItem
+ //
+ this.customizationToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.postSetupToolStripMenuItem});
+ this.customizationToolStripMenuItem.Name = "customizationToolStripMenuItem";
+ this.customizationToolStripMenuItem.Size = new System.Drawing.Size(47, 20);
+ this.customizationToolStripMenuItem.Text = "Setup";
+ //
+ // postSetupToolStripMenuItem
+ //
+ this.postSetupToolStripMenuItem.Name = "postSetupToolStripMenuItem";
+ this.postSetupToolStripMenuItem.Size = new System.Drawing.Size(137, 22);
+ this.postSetupToolStripMenuItem.Text = "Post Setup";
+ this.postSetupToolStripMenuItem.Click += new System.EventHandler(this.postSetupToolStripMenuItem_Click);
+ //
// bossview
//
this.bossview.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
@@ -800,21 +811,27 @@
this.toolStripContainer1.TabIndex = 5;
this.toolStripContainer1.Text = "toolStripContainer1";
//
- // customizationToolStripMenuItem
+ // soundsToolStripMenuItem
//
- this.customizationToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.postSetupToolStripMenuItem});
- this.customizationToolStripMenuItem.Name = "customizationToolStripMenuItem";
- this.customizationToolStripMenuItem.Size = new System.Drawing.Size(47, 20);
- this.customizationToolStripMenuItem.Text = "Setup";
+ this.soundsToolStripMenuItem.Name = "soundsToolStripMenuItem";
+ this.soundsToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.soundsToolStripMenuItem.Text = "Sounds";
+ this.soundsToolStripMenuItem.Click += new System.EventHandler(this.soundsToolStripMenuItem_Click);
//
- // postSetupToolStripMenuItem
+ // animationsToolStripMenuItem
//
- this.postSetupToolStripMenuItem.Name = "postSetupToolStripMenuItem";
- this.postSetupToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
- this.postSetupToolStripMenuItem.Text = "Post Setup";
- this.postSetupToolStripMenuItem.Click += new System.EventHandler(this.postSetupToolStripMenuItem_Click);
+ this.animationsToolStripMenuItem.Name = "animationsToolStripMenuItem";
+ this.animationsToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.animationsToolStripMenuItem.Text = "Animations";
+ this.animationsToolStripMenuItem.Click += new System.EventHandler(this.animationsToolStripMenuItem_Click);
//
+ // tetrisToolStripMenuItem
+ //
+ this.tetrisToolStripMenuItem.Name = "tetrisToolStripMenuItem";
+ this.tetrisToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.tetrisToolStripMenuItem.Text = "Tetris";
+ this.tetrisToolStripMenuItem.Click += new System.EventHandler(this.tetrisToolStripMenuItem_Click);
+ //
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -879,7 +896,6 @@
private System.Windows.Forms.ToolStripMenuItem skinToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem componentToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem mediaToolStripMenuItem;
- private System.Windows.Forms.ToolStripMenuItem fullToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem openProiectToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem sToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveProiectAsToolStripMenuItem;
@@ -936,6 +952,9 @@
private System.Windows.Forms.ToolStripContainer toolStripContainer1;
private System.Windows.Forms.ToolStripMenuItem customizationToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem postSetupToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem soundsToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem animationsToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem tetrisToolStripMenuItem;
}
}
Modified: trunk/plugins/mpinstaler/MPInstaler/Form1.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/Form1.cs 2007-04-10 12:11:44 UTC (rev 312)
+++ trunk/plugins/mpinstaler/MPInstaler/Form1.cs 2007-04-11 19:10:20 UTC (rev 313)
@@ -130,6 +130,15 @@
case 2: openFileDialog1.Filter = "png files (*.png)|*.png|bmp files (*.bmp)|*.bmp|xml files (*.xml)|*.xml|All files (*.*)|*.*";
openFileDialog1.DefaultExt = "*.png";
break;
+ case 3: openFileDialog1.Filter = "wav files (*.wav)|*.wav|All files (*.*)|*.*";
+ openFileDialog1.DefaultExt = "*.wav";
+ break;
+ case 4: openFileDialog1.Filter = "png files (*.png)|*.png|bmp files (*.bmp)|*.bmp|xml files (*.xml)|*.xml|All files (*.*)|*.*";
+ openFileDialog1.DefaultExt = "*.png";
+ break;
+ case 5: openFileDialog1.Filter = "png files (*.png)|*.png|bmp files (*.bmp)|*.bmp|xml files (*.xml)|*.xml|All files (*.*)|*.*";
+ openFileDialog1.DefaultExt = "*.png";
+ break;
}
if (openFileDialog1.ShowDialog(this) == DialogResult.OK)
{
@@ -149,6 +158,12 @@
break;
case 2: addrow(Path.GetFileName(fil),MPinstalerStruct.SKIN_MEDIA_TYPE, subtype, Path.GetFullPath(fil), "02020","");
break;
+ case 3: addrow(Path.GetFileName(fil), MPinstalerStruct.SKIN_SOUNDS_TYPE, subtype, Path.GetFullPath(fil), "02030", "");
+ break;
+ case 4: addrow(Path.GetFileName(fil), MPinstalerStruct.SKIN_ANIMATIONS_TYPE, subtype, Path.GetFullPath(fil), "02040", "");
+ break;
+ case 5: addrow(Path.GetFileName(fil), MPinstalerStruct.SKIN_TETRIS_TYPE, subtype, Path.GetFullPath(fil), "02050", "");
+ break;
default:
break;
}
@@ -536,5 +551,20 @@
dlg._struct = this._struct;
dlg.ShowDialog();
}
+
+ private void soundsToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ addskin(3);
+ }
+
+ private void animationsToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ addskin(4);
+ }
+
+ private void tetrisToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ addskin(5);
+ }
}
}
\ No newline at end of file
Modified: trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs 2007-04-10 12:11:44 UTC (rev 312)
+++ trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs 2007-04-11 19:10:20 UTC (rev 313)
@@ -25,6 +25,9 @@
public const string PLUGIN_PLAYER_SUBTYPE = "External Player";
public const string SKIN_TYPE = "Skin";
public const string SKIN_MEDIA_TYPE = "Media";
+ public const string SKIN_SOUNDS_TYPE = "Sounds";
+ public const string SKIN_ANIMATIONS_TYPE = "Animations";
+ public const string SKIN_TETRIS_TYPE = "Tetris";
public const string SKIN_XML_SUBTYPE = "Genskin";
public const string TEXT_TYPE = "Text";
public const string TEXT_EULA_TYPE = "EULA";
@@ -448,6 +451,21 @@
ret = "Release" + @"\" + "Skin" + @"\" + flst.SubType + @"\" + "Media" + @"\" + Path.GetFileName(flst.FileName);
}
+ if (flst.Type == SKIN_SOUNDS_TYPE)
+ {
+ ret = "Release" + @"\" + "Skin" + @"\" + flst.SubType + @"\" + "Sounds" + @"\" + Path.GetFileName(flst.FileName);
+ }
+
+ if (flst.Type == SKIN_ANIMATIONS_TYPE)
+ {
+ ret = "Release" + @"\" + "Skin" + @"\" + flst.SubType + @"\" + "Media" + @"\" + "Animations" + @"\" + Path.GetFileName(flst.FileName);
+ }
+
+ if (flst.Type == SKIN_TETRIS_TYPE)
+ {
+ ret = "Release" + @"\" + "Skin" + @"\" + flst.SubType + @"\" + "Media" + @"\" + "Tetris" + @"\" + Path.GetFileName(flst.FileName);
+ }
+
if (flst.Type == TEXT_TYPE)
{
ret = "Release" + @"\" + "Text" + @"\" + flst.SubType + @"\" + Path.GetFileName(flst.FileName);
@@ -503,6 +521,20 @@
ret = Config.GetFolder(Config.Dir.Skin) + @"\" + flst.SubType + @"\" + "Media" + @"\" + Path.GetFileName(flst.FileName);
}
+ if (flst.Type == SKIN_SOUNDS_TYPE)
+ {
+ ret = Config.GetFolder(Config.Dir.Skin) + @"\" + flst.SubType + @"\" + "Sounds" + @"\" + Path.GetFileName(flst.FileName);
+ }
+
+ if (flst.Type == SKIN_ANIMATIONS_TYPE)
+ {
+ ret = Config.GetFolder(Config.Dir.Skin) + @"\" + flst.SubType + @"\" + "Media" + @"\" + "Animations" + @"\" + Path.GetFileName(flst.FileName);
+ }
+ if (flst.Type == SKIN_TETRIS_TYPE)
+ {
+ ret = Config.GetFolder(Config.Dir.Skin) + @"\" + flst.SubType + @"\" + "Media" + @"\" + "Tetris" + @"\" + Path.GetFileName(flst.FileName);
+ }
+
if (flst.Type == THUMBS_TYPE)
{
ret = Config.GetFolder(Config.Dir.Thumbs) + @"\" + flst.SubType +@"\" + Path.GetFileName(flst.FileName);
Modified: trunk/plugins/mpinstaler/MPInstaler/MPpackageStruct.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/MPpackageStruct.cs 2007-04-10 12:11:44 UTC (rev 312)
+++ trunk/plugins/mpinstaler/MPInstaler/MPpackageStruct.cs 2007-04-11 19:10:20 UTC (rev 313)
@@ -60,7 +60,7 @@
if (test_file(fl,entry))
{
string tpf =Path.GetFullPath(MPinstalerStruct.GetDirEntry(fl)) ;
- if (fl.Type == MPinstalerStruct.SKIN_TYPE || fl.Type == MPinstalerStruct.SKIN_MEDIA_TYPE)
+ if (fl.Type == MPinstalerStruct.SKIN_TYPE || fl.Type == MPinstalerStruct.SKIN_MEDIA_TYPE || fl.Type == MPinstalerStruct.SKIN_SOUNDS_TYPE || fl.Type == MPinstalerStruct.SKIN_ANIMATIONS_TYPE || fl.Type == MPinstalerStruct.SKIN_TETRIS_TYPE)
{
if (!Directory.Exists(Path.GetDirectoryName(tpf)))
Directory.CreateDirectory(Path.GetDirectoryName(tpf));
Modified: trunk/plugins/mpinstaler/MPInstaler/download_form.Designer.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/download_form.Designer.cs 2007-04-10 12:11:44 UTC (rev 312)
+++ trunk/plugins/mpinstaler/MPInstaler/download_form.Designer.cs 2007-04-11 19:10:20 UTC (rev 313)
@@ -32,6 +32,7 @@
this.button1 = new System.Windows.Forms.Button();
this.progressBar1 = new System.Windows.Forms.ProgressBar();
this.label1 = new System.Windows.Forms.Label();
+ this.label2 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// button1
@@ -49,6 +50,7 @@
this.progressBar1.Location = new System.Drawing.Point(12, 34);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(419, 23);
+ this.progressBar1.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
this.progressBar1.TabIndex = 1;
//
// label1
@@ -60,11 +62,20 @@
this.label1.TabIndex = 2;
this.label1.Text = "Downloading";
//
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(201, 9);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(0, 13);
+ this.label2.TabIndex = 3;
+ //
// download_form
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(443, 114);
+ this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.progressBar1);
this.Controls.Add(this.button1);
@@ -85,5 +96,6 @@
private System.Windows.Forms.Button button1;
private System.Windows.Forms.ProgressBar progressBar1;
private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Label label2;
}
}
\ No newline at end of file
Modified: trunk/plugins/mpinstaler/MPInstaler/download_form.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/download_form.cs 2007-04-10 12:11:44 UTC (rev 312)
+++ trunk/plugins/mpinstaler/MPInstaler/download_form.cs 2007-04-11 19:10:20 UTC (rev 313)
@@ -52,6 +52,7 @@
// e.TotalBytesToReceive,
// e.ProgressPercentage);
progressBar1.Value = e.ProgressPercentage;
+ label2.Text = string.Format("{0}/{1}", e.BytesReceived, e.TotalBytesToReceive);
}
private void UploadProgressCallback(object sender, UploadProgressChangedEventArgs e)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kro...@us...> - 2007-04-10 12:11:47
|
Revision: 312
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=312&view=rev
Author: kroko_koenig
Date: 2007-04-10 05:11:44 -0700 (Tue, 10 Apr 2007)
Log Message:
-----------
Reorganize DIR
Modified Paths:
--------------
trunk/plugins/MySimon/readme.txt
Added Paths:
-----------
trunk/plugins/MySimon/SimpleMP-simonsays.jpg
trunk/plugins/MySimon/Source/SimonSay/MySimon.cs
trunk/plugins/MySimon/Source/SimonSay/MySimon.csproj
trunk/plugins/MySimon/Source/SimonSay.sln
trunk/plugins/MySimon/Source/SimonSay.suo
Removed Paths:
-------------
trunk/plugins/MySimon/Release/
trunk/plugins/MySimon/Source/SimonSay/SimonSay/
trunk/plugins/MySimon/Source/SimonSay/SimonSay.sln
trunk/plugins/MySimon/Source/SimonSay/SimonSay.suo
trunk/plugins/MySimon/Source/SimpleMP-simonsays.jpg
trunk/plugins/MySimon/Source/Skin/
trunk/plugins/MySimon/Source/readme.txt
Added: trunk/plugins/MySimon/SimpleMP-simonsays.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/MySimon/SimpleMP-simonsays.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/MySimon/Source/SimonSay/MySimon.cs
===================================================================
--- trunk/plugins/MySimon/Source/SimonSay/MySimon.cs (rev 0)
+++ trunk/plugins/MySimon/Source/SimonSay/MySimon.cs 2007-04-10 12:11:44 UTC (rev 312)
@@ -0,0 +1,517 @@
+#region Copyright (C) 2005-2007 Team MediaPortal
+
+/*
+ * Copyright (C) 2005-2007 Team MediaPortal
+ * http://www.team-mediaportal.com
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows.Forms;
+using MediaPortal.GUI.Library;
+using MediaPortal.Dialogs;
+using MediaPortal.Util;
+using MediaPortal.Utils;
+
+namespace MediaPortal.GUI.MySimon
+{
+ public class MySimonGUI : GUIWindow , ISetupForm
+ {
+ #region SkinControl
+ [SkinControlAttribute(2)] protected GUIButtonControl BtnStart = null;
+ [SkinControlAttribute(3)] protected GUIButtonControl BtnLevel = null;
+
+ [SkinControlAttribute(6)] protected GUIButtonControl BtnWhatsThis = null;
+
+ [SkinControlAttribute(101)] protected GUIButtonControl BtnRed = null;
+ [SkinControlAttribute(102)] protected GUIButtonControl BtnBlue = null;
+ [SkinControlAttribute(103)] protected GUIButtonControl BtnGreen = null;
+ [SkinControlAttribute(104)] protected GUIButtonControl BtnYellow = null;
+ #endregion
+
+ #region Private variables
+ string Level="Am"; //Choosen level
+
+ Boolean SimonOn = false;
+ Boolean PlayerOn = false;
+
+ int[] Code = new int[100];
+
+ int timeBase = 0;
+ int timeActual = 0;
+ int timeWait = 0;
+
+ int round = 0;
+ int cnt = 0;
+
+ private static OnActionHandler ah;
+
+ private System.Windows.Forms.Timer _Game = new System.Windows.Forms.Timer();
+ #endregion
+
+ #region ISetupForm Members
+
+ // Returns the name of the plugin which is shown in the plugin menu
+ public string PluginName()
+ {
+ return "My Simon Say";
+ }
+
+ // Returns the description of the plugin is shown in the plugin menu
+ public string Description()
+ {
+ return "Simon Say";
+ }
+
+ // Returns the author of the plugin which is shown in the plugin menu
+ public string Author()
+ {
+ return "Mark Koenig (kroko)";
+ }
+
+ // show the setup dialog
+ public void ShowPlugin()
+ {
+ MessageBox.Show("Nothing to configure, this is just an example");
+ }
+
+ // Indicates whether plugin can be enabled/disabled
+ public bool CanEnable()
+ {
+ return true;
+ }
+
+ // get ID of windowplugin belonging to this setup
+ public int GetWindowId()
+ {
+ return 04071975;
+ }
+
+ // Indicates if plugin is enabled by default;
+ public bool DefaultEnabled()
+ {
+ return true;
+ }
+
+ // indicates if a plugin has its own setup screen
+ public bool HasSetup()
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// If the plugin should have its own button on the main menu of MediaPortal then it
+ /// should return true to this method, otherwise if it should not be on home
+ /// it should return false
+ /// </summary>
+ /// <param name="strButtonText">text the button should have</param>
+ /// <param name="strButtonImage">image for the button, or empty for default</param>
+ /// <param name="strButtonImageFocus">image for the button, or empty for default</param>
+ /// <param name="strPictureImage">subpicture for the button or empty for none</param>
+ /// <returns>true : plugin needs its own button on home
+ /// false : plugin does not need its own button on home</returns>
+
+ public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage)
+ {
+ strButtonText = PluginName();
+ strButtonImage = String.Empty;
+ strButtonImageFocus = String.Empty;
+ strPictureImage = "hover_my simon.png";
+ return true;
+ }
+
+ #endregion
+
+ public override int GetID
+ {
+ get
+ {
+ return 04071975;
+ }
+ set
+ {
+ base.GetID = value;
+ }
+ }
+
+ public override bool Init()
+ {
+ bool result = Load(GUIGraphicsContext.Skin + @"\MySimon.xml");
+ if (ah == null) ah = new OnActionHandler(OnAction2);
+ return result;
+ }
+
+ #region Actions
+ public override void OnAction(Action action)
+ {
+ base.OnAction(action);
+ }
+ public void OnAction2(Action action)
+ {
+
+ if (GUIWindowManager.ActiveWindowEx == (int)GUIWindow.Window.WINDOW_DIALOG_MENU) return;
+
+ //string t = action.wID.ToString();
+ //GUIPropertyManager.SetProperty("#Round", t);
+
+ if (PlayerOn)
+ {
+ switch (action.wID)
+ {
+ //normal
+ case Action.ActionType.ACTION_REMOTE_RED_BUTTON:
+ Check(0);
+ break;
+ case Action.ActionType.ACTION_REMOTE_BLUE_BUTTON:
+ Check(1);
+ break;
+ case Action.ActionType.ACTION_REMOTE_GREEN_BUTTON:
+ Check(2);
+ break;
+ case Action.ActionType.ACTION_REMOTE_YELLOW_BUTTON:
+ Check(3);
+ break;
+ //my PC
+ case Action.ActionType.ACTION_SHOW_GUI:
+ Check(0);
+ break;
+ case Action.ActionType.ACTION_ASPECT_RATIO:
+ Check(1);
+ break;
+ case Action.ActionType.ACTION_NEXT_AUDIO:
+ Check(2);
+ break;
+ case Action.ActionType.ACTION_SHOW_INFO:
+ Check(3);
+ break;
+ // play with 1 2
+ // play with 4 5
+ case Action.ActionType.ACTION_KEY_PRESSED:
+ switch (action.m_key.KeyChar)
+ {
+ case '1':
+ Check(0);
+ break;
+ case '2':
+ Check(1);
+ break;
+ case '4':
+ Check(2);
+ break;
+ case '5':
+ Check(3);
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ #endregion
+
+ public override bool OnMessage(GUIMessage message)
+ {
+ return base.OnMessage(message);
+ }
+
+ public void Dispose()
+ {
+ _Game.Stop();
+ _Game.Tick -= new EventHandler(_Game_Tick);
+ }
+
+ protected override void OnPageLoad()
+ {
+ _Game.Interval = 5;
+ _Game.Tick += new EventHandler(_Game_Tick);
+ _Game.Start();
+
+ SimonOn = false;
+ PlayerOn = false;
+ Level = "Am";
+
+ GUIGraphicsContext.OnNewAction -= ah;
+ GUIGraphicsContext.OnNewAction += ah;
+
+ base.OnPageLoad();
+
+ Reset();
+
+ GUIPropertyManager.SetProperty("#Round", "Round: 1");
+ GUIPropertyManager.SetProperty("#Player", "GAME OVER");
+ }
+
+ protected override void OnPageDestroy(int new_windowId)
+ {
+ _Game.Stop();
+ _Game.Tick -= new EventHandler(_Game_Tick);
+ }
+
+ protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
+ {
+ if (control == BtnLevel)
+ OnBtnLevel();
+ if (control == BtnWhatsThis)
+ OnBtnWhatsThis();
+ if (control == BtnStart)
+ { //start game
+ if ((!PlayerOn) && (!SimonOn))
+ {
+ Random randObj = new Random();
+ for (int i = 0; i <= 99; i++)
+ { // do random colors for 100 rounds
+ Code[i] = (int)(randObj.NextDouble() * 4);
+ }
+ // set timebase for game
+ if (Level == "Pro")
+ timeBase = 4;
+ if (Level == "Nor")
+ timeBase = 10;
+ if (Level == "Am")
+ timeBase = 20;
+
+ // disable level selection
+ GUIControl.DisableControl(GetID, 3);
+
+ timeActual = timeBase;
+ Reset();
+
+ //init round
+ round = 0;
+ cnt = 0;
+ //simonn starts
+ SimonOn = true;
+ }
+ }
+ if (PlayerOn)
+ {
+ if ((controlId >= 101) && (controlId <= 104))
+ { //which button has clicked ?
+ if (controlId == 101) Check(0);
+ if (controlId == 102) Check(1);
+ if (controlId == 103) Check(2);
+ if (controlId == 104) Check(3);
+ }
+ }
+ base.OnClicked(controlId, control, actionType);
+ }
+
+ protected override void OnShowContextMenu()
+ {
+ base.OnShowContextMenu();
+ }
+
+ private void OnBtnLevel()
+ { //Choose level for the game
+ if ((!PlayerOn) && (!SimonOn))
+ {
+ if (Level == "Nor")
+ {
+ GUIControl.SetControlLabel(GetID, BtnLevel.GetID, "Level: Professional");
+ Level = "Pro";
+ }
+ else if (Level == "Pro")
+ {
+ GUIControl.SetControlLabel(GetID, BtnLevel.GetID, "Level: Amateur");
+ Level = "Am";
+ }
+ else
+ {
+ GUIControl.SetControlLabel(GetID, BtnLevel.GetID, "Level: Normal");
+ Level = "Nor";
+ }
+ }
+ }
+
+ private void OnBtnWhatsThis()
+ {
+ GUIDialogText dlg = (GUIDialogText)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_TEXT);
+ dlg.SetHeading("What's Simon Say (Senso)");
+ dlg.SetText("Simon Say is a game where your object is to repeat a code of\n" +
+ "tones and colors.\n" +
+ "Level Amateur/Normal/Professional: Speed is increasing\n\n" +
+ "Gameboard design by Mikael S\xF6derstr\xF6m.\n\n" +
+ "Remote play with the colored buttons or use 1 - 2 - 4 - 5.\n\n" +
+ "Good luck\nkroko");
+ dlg.DoModal(GetID);
+ }
+
+ private void Red()
+ { // draw red field on
+ GUIPropertyManager.SetProperty("#Senso1", "MySimon_1a.png");
+ MediaPortal.Util.Utils.PlaySound ("MySimon_c.wav", false, true);
+ }
+ private void Blue()
+ { // draw blue field on
+ GUIPropertyManager.SetProperty("#Senso2", "MySimon_2a.png");
+ MediaPortal.Util.Utils.PlaySound("MySimon_e.wav", false, true);
+ }
+ private void Green()
+ { // draw green field on
+ GUIPropertyManager.SetProperty("#Senso3", "MySimon_3a.png");
+ MediaPortal.Util.Utils.PlaySound("MySimon_g.wav", false, true);
+ }
+ private void Yellow()
+ { // draw yellow field on
+ GUIPropertyManager.SetProperty("#Senso4", "MySimon_4a.png");
+ MediaPortal.Util.Utils.PlaySound("MySimon_a.wav", false, true);
+ }
+ private void Error(int errNo)
+ { // draw correct field on
+ Reset();
+ if (errNo== 0)
+ GUIPropertyManager.SetProperty("#Senso1", "MySimon_1a.png");
+ if (errNo == 1)
+ GUIPropertyManager.SetProperty("#Senso2", "MySimon_2a.png");
+ if (errNo == 2)
+ GUIPropertyManager.SetProperty("#Senso3", "MySimon_3a.png");
+ if (errNo == 3)
+ GUIPropertyManager.SetProperty("#Senso4", "MySimon_4a.png");
+
+ MediaPortal.Util.Utils.PlaySound("MySimon_err.wav", false, true);
+
+ // Enable level selection
+ GUIControl.EnableControl(GetID, 3);
+ }
+ private void Reset()
+ { // draw all fields off
+ GUIPropertyManager.SetProperty("#Senso1", "MySimon_1.png");
+ GUIPropertyManager.SetProperty("#Senso2", "MySimon_2.png");
+ GUIPropertyManager.SetProperty("#Senso3", "MySimon_3.png");
+ GUIPropertyManager.SetProperty("#Senso4", "MySimon_4.png");
+ }
+
+ private void Check(int Button)
+ {
+ Reset(); // reset display
+ timeActual = timeBase; // set time to base
+
+ if (Button == 0)
+ { //red is pressed
+ Red();
+ }
+ if (Button == 1)
+ { //blue is pressed
+ Blue();
+ }
+ if (Button == 2)
+ { //green is pressed
+ Green();
+ }
+ if (Button == 3)
+ { //yellow is pressed
+ Yellow();
+ }
+ if (Code[cnt] != Button )
+ { //wrong color is pressed
+ PlayerOn = false;
+ Error(Code[cnt]);
+ }
+ else
+ { // color is correct
+ cnt++; // next tone
+ timeActual = 30; // check time for player
+ if (cnt > round) // last tone reached ?
+ {
+ PlayerOn = false; // Simon is now on
+ SimonOn = true;
+
+ cnt = 0; // Start with tone 0
+ round++; // next Round
+
+ if (timeBase >4) // increased difficulty
+ timeBase--;
+
+ timeWait = 30; // wait a little
+ timeActual = timeBase; // reset timer
+ }
+ }
+ }
+
+ void _Game_Tick(object sender, EventArgs e)
+ { //display status of the game
+ if ((!PlayerOn) && (!SimonOn))
+ GUIPropertyManager.SetProperty("#Player", "GAME OVER");
+ if (PlayerOn)
+ GUIPropertyManager.SetProperty("#Player", "PLAYER");
+ if (SimonOn)
+ GUIPropertyManager.SetProperty("#Player", "SIMON");
+ //Simon is on and no wait
+ if ((SimonOn) && (timeWait==0))
+ { // just started ?
+ if (timeBase == timeActual)
+ { //Display color
+ if (Code[cnt] == 0)
+ Red();
+ if (Code[cnt] == 1)
+ Blue();
+ if (Code[cnt] == 2)
+ Green();
+ if (Code[cnt] == 3)
+ Yellow();
+
+ //Display round
+ int tmp = round + 1;
+ GUIPropertyManager.SetProperty("#Round", "Round: " + tmp.ToString() + " ");
+ } //count timer down
+ if (timeActual > 0)
+ timeActual = timeActual - 1;
+ else
+ { //if timer is 0
+ timeActual = timeBase;
+ Reset();
+ //next tone
+ if (cnt < round)
+ cnt++;
+ else
+ { //player is next
+ SimonOn = false;
+ PlayerOn = true;
+ // first tone a lot of time
+ timeActual = 50;
+ cnt = 0;
+ }
+ }
+ }
+
+ if (timeWait > 0)
+ { //wait timer for little break
+ timeWait = timeWait - 1;
+ if (timeWait==timeBase)
+ Reset();
+ }
+
+ if (PlayerOn)
+ { // if player is on count down timer
+ if (timeActual > 0)
+ timeActual = timeActual - 1;
+ else
+ { //Player wait too long
+ PlayerOn = false;
+ Error(Code[cnt]);
+ //Reset();
+ }
+ }
+ }
+ }
+}
Added: trunk/plugins/MySimon/Source/SimonSay/MySimon.csproj
===================================================================
--- trunk/plugins/MySimon/Source/SimonSay/MySimon.csproj (rev 0)
+++ trunk/plugins/MySimon/Source/SimonSay/MySimon.csproj 2007-04-10 12:11:44 UTC (rev 312)
@@ -0,0 +1,53 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{206A81B8-D452-45C2-86C9-CBBECF31C11C}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>ClassLibrary1</RootNamespace>
+ <AssemblyName>MySimon</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Core, Version=1.0.2593.1921, Culture=neutral, processorArchitecture=MSIL">
+ <Private>True</Private>
+ </Reference>
+ <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ <Reference Include="Utils, Version=1.0.2593.1896, Culture=neutral, processorArchitecture=MSIL" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="MySimon.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
Deleted: trunk/plugins/MySimon/Source/SimonSay/SimonSay.sln
===================================================================
--- trunk/plugins/MySimon/Source/SimonSay/SimonSay.sln 2007-04-10 12:09:04 UTC (rev 311)
+++ trunk/plugins/MySimon/Source/SimonSay/SimonSay.sln 2007-04-10 12:11:44 UTC (rev 312)
@@ -1,20 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MySimon", "SimonSay\MySimon.csproj", "{206A81B8-D452-45C2-86C9-CBBECF31C11C}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {206A81B8-D452-45C2-86C9-CBBECF31C11C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {206A81B8-D452-45C2-86C9-CBBECF31C11C}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {206A81B8-D452-45C2-86C9-CBBECF31C11C}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {206A81B8-D452-45C2-86C9-CBBECF31C11C}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
Deleted: trunk/plugins/MySimon/Source/SimonSay/SimonSay.suo
===================================================================
(Binary files differ)
Added: trunk/plugins/MySimon/Source/SimonSay.sln
===================================================================
--- trunk/plugins/MySimon/Source/SimonSay.sln (rev 0)
+++ trunk/plugins/MySimon/Source/SimonSay.sln 2007-04-10 12:11:44 UTC (rev 312)
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MySimon", "SimonSay\MySimon.csproj", "{206A81B8-D452-45C2-86C9-CBBECF31C11C}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {206A81B8-D452-45C2-86C9-CBBECF31C11C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {206A81B8-D452-45C2-86C9-CBBECF31C11C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {206A81B8-D452-45C2-86C9-CBBECF31C11C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {206A81B8-D452-45C2-86C9-CBBECF31C11C}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
Added: trunk/plugins/MySimon/Source/SimonSay.suo
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/MySimon/Source/SimonSay.suo
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: trunk/plugins/MySimon/Source/SimpleMP-simonsays.jpg
===================================================================
(Binary files differ)
Deleted: trunk/plugins/MySimon/Source/readme.txt
===================================================================
--- trunk/plugins/MySimon/Source/readme.txt 2007-04-10 12:09:04 UTC (rev 311)
+++ trunk/plugins/MySimon/Source/readme.txt 2007-04-10 12:11:44 UTC (rev 312)
@@ -1,52 +0,0 @@
-Visit the forum
-http://forum.team-mediaportal.com/new_game_simon_say-t19473.html
-
-Simon Say V0.3.1
-----------------
-
--added time display on skin
--modify the skin a little
--enable hover picture
-
-Simon Say V0.3
---------------
-
--Added the great design from Mikael S\xF6derstr\xF6m.
-
-Simon Say V0.2
---------------
-
-Simon Say (Senso)
-
--Changed the window ID
--disable level selection during gameplay
--added button help in "what's this"
-
-Have fun.
-
-Greetz
-kroko
-
-
-Simon Say V0.1
---------------
-
-Simon Say (Senso)
-
-Initial release
-This nice game from MB as a MP version. You can play with
-
-- the mouse
-- remote color buttons
-- 1 2
- 4 5 (action keys)
-
-Copy the plugin and skin files into your favorite skin folder.
-I had to adjust my remote a little in the setup. It was to sensitve.
-
-Planed feature: Highscores ?
-
-Have fun.
-
-Greetz
-kroko
\ No newline at end of file
Modified: trunk/plugins/MySimon/readme.txt
===================================================================
--- trunk/plugins/MySimon/readme.txt 2007-04-10 12:09:04 UTC (rev 311)
+++ trunk/plugins/MySimon/readme.txt 2007-04-10 12:11:44 UTC (rev 312)
@@ -1,3 +1,33 @@
+Visit the forum
+http://forum.team-mediaportal.com/new_game_simon_say-t19473.html
+
+Simon Say V0.3.1
+----------------
+
+-added time display on skin
+-modify the skin a little
+-enable hover picture
+
+Simon Say V0.3
+--------------
+
+-Added the great design from Mikael S\xF6derstr\xF6m.
+
+Simon Say V0.2
+--------------
+
+Simon Say (Senso)
+
+-Changed the window ID
+-disable level selection during gameplay
+-added button help in "what's this"
+
+Have fun.
+
+Greetz
+kroko
+
+
Simon Say V0.1
--------------
@@ -18,5 +48,5 @@
Have fun.
-Greets
+Greetz
kroko
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kro...@us...> - 2007-04-10 12:09:13
|
Revision: 311
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=311&view=rev
Author: kroko_koenig
Date: 2007-04-10 05:09:04 -0700 (Tue, 10 Apr 2007)
Log Message:
-----------
Update to V0.3.1
Modified Paths:
--------------
trunk/plugins/MySimon/Source/SimonSay/SimonSay/MySimon.cs
trunk/plugins/MySimon/Source/SimonSay/SimonSay/MySimon.csproj
trunk/plugins/MySimon/Source/SimonSay/SimonSay.suo
Added Paths:
-----------
trunk/plugins/MySimon/Source/SimpleMP-simonsays.jpg
trunk/plugins/MySimon/Source/Skin/
trunk/plugins/MySimon/Source/Skin/Media/
trunk/plugins/MySimon/Source/Skin/Media/MySimon_1.png
trunk/plugins/MySimon/Source/Skin/Media/MySimon_1a.png
trunk/plugins/MySimon/Source/Skin/Media/MySimon_2.png
trunk/plugins/MySimon/Source/Skin/Media/MySimon_2a.png
trunk/plugins/MySimon/Source/Skin/Media/MySimon_3.png
trunk/plugins/MySimon/Source/Skin/Media/MySimon_3a.png
trunk/plugins/MySimon/Source/Skin/Media/MySimon_4.png
trunk/plugins/MySimon/Source/Skin/Media/MySimon_4a.png
trunk/plugins/MySimon/Source/Skin/Media/hover_my simon.png
trunk/plugins/MySimon/Source/Skin/MySimon.xml
trunk/plugins/MySimon/Source/Skin/Sounds/
trunk/plugins/MySimon/Source/Skin/Sounds/MySimon_a.wav
trunk/plugins/MySimon/Source/Skin/Sounds/MySimon_c.wav
trunk/plugins/MySimon/Source/Skin/Sounds/MySimon_e.wav
trunk/plugins/MySimon/Source/Skin/Sounds/MySimon_err.wav
trunk/plugins/MySimon/Source/Skin/Sounds/MySimon_g.wav
trunk/plugins/MySimon/Source/readme.txt
Removed Paths:
-------------
trunk/plugins/MySimon/Source/SimonSay/SimonSay/bin/
trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/
Modified: trunk/plugins/MySimon/Source/SimonSay/SimonSay/MySimon.cs
===================================================================
--- trunk/plugins/MySimon/Source/SimonSay/SimonSay/MySimon.cs 2007-04-10 11:58:17 UTC (rev 310)
+++ trunk/plugins/MySimon/Source/SimonSay/SimonSay/MySimon.cs 2007-04-10 12:09:04 UTC (rev 311)
@@ -103,7 +103,7 @@
// get ID of windowplugin belonging to this setup
public int GetWindowId()
{
- return 0709;
+ return 04071975;
}
// Indicates if plugin is enabled by default;
@@ -135,7 +135,7 @@
strButtonText = PluginName();
strButtonImage = String.Empty;
strButtonImageFocus = String.Empty;
- strPictureImage = String.Empty;
+ strPictureImage = "hover_my simon.png";
return true;
}
@@ -145,7 +145,7 @@
{
get
{
- return 0709;
+ return 04071975;
}
set
{
@@ -290,6 +290,9 @@
if (Level == "Am")
timeBase = 20;
+ // disable level selection
+ GUIControl.DisableControl(GetID, 3);
+
timeActual = timeBase;
Reset();
@@ -347,9 +350,8 @@
dlg.SetText("Simon Say is a game where your object is to repeat a code of\n" +
"tones and colors.\n" +
"Level Amateur/Normal/Professional: Speed is increasing\n\n" +
- "I would like to say 'Thank You' to MB for their great games.\n" +
- "In my earlier day's I had a lot of them. We had a lot of fun\n" +
- "playing them.\n\n" +
+ "Gameboard design by Mikael S\xF6derstr\xF6m.\n\n" +
+ "Remote play with the colored buttons or use 1 - 2 - 4 - 5.\n\n" +
"Good luck\nkroko");
dlg.DoModal(GetID);
}
@@ -387,6 +389,9 @@
GUIPropertyManager.SetProperty("#Senso4", "MySimon_4a.png");
MediaPortal.Util.Utils.PlaySound("MySimon_err.wav", false, true);
+
+ // Enable level selection
+ GUIControl.EnableControl(GetID, 3);
}
private void Reset()
{ // draw all fields off
Modified: trunk/plugins/MySimon/Source/SimonSay/SimonSay/MySimon.csproj
===================================================================
--- trunk/plugins/MySimon/Source/SimonSay/SimonSay/MySimon.csproj 2007-04-10 11:58:17 UTC (rev 310)
+++ trunk/plugins/MySimon/Source/SimonSay/SimonSay/MySimon.csproj 2007-04-10 12:09:04 UTC (rev 311)
@@ -28,7 +28,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Core, Version=1.0.2593.1921, Culture=neutral, processorArchitecture=MSIL" />
+ <Reference Include="Core, Version=1.0.2593.1921, Culture=neutral, processorArchitecture=MSIL">
+ <Private>True</Private>
+ </Reference>
<Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="System" />
<Reference Include="System.Data" />
Modified: trunk/plugins/MySimon/Source/SimonSay/SimonSay.suo
===================================================================
(Binary files differ)
Added: trunk/plugins/MySimon/Source/SimpleMP-simonsays.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/MySimon/Source/SimpleMP-simonsays.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/MySimon/Source/Skin/Media/MySimon_1.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/MySimon/Source/Skin/Media/MySimon_1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/MySimon/Source/Skin/Media/MySimon_1a.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/MySimon/Source/Skin/Media/MySimon_1a.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/MySimon/Source/Skin/Media/MySimon_2.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/MySimon/Source/Skin/Media/MySimon_2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/MySimon/Source/Skin/Media/MySimon_2a.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/MySimon/Source/Skin/Media/MySimon_2a.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/MySimon/Source/Skin/Media/MySimon_3.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/MySimon/Source/Skin/Media/MySimon_3.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/MySimon/Source/Skin/Media/MySimon_3a.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/MySimon/Source/Skin/Media/MySimon_3a.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/MySimon/Source/Skin/Media/MySimon_4.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/MySimon/Source/Skin/Media/MySimon_4.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/MySimon/Source/Skin/Media/MySimon_4a.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/MySimon/Source/Skin/Media/MySimon_4a.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/MySimon/Source/Skin/Media/hover_my simon.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/MySimon/Source/Skin/Media/hover_my simon.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/MySimon/Source/Skin/MySimon.xml
===================================================================
--- trunk/plugins/MySimon/Source/Skin/MySimon.xml (rev 0)
+++ trunk/plugins/MySimon/Source/Skin/MySimon.xml 2007-04-10 12:09:04 UTC (rev 311)
@@ -0,0 +1,148 @@
+<window>
+ <id>04071975</id>
+ <defaultcontrol>2</defaultcontrol>
+ <allowoverlay>yes</allowoverlay>
+ <autohidetopbar>yes</autohidetopbar>
+ <controls>
+ <import>common.time.xml</import>
+ <control>
+ <description>BackGround</description>
+ <type>image</type>
+ <id>1</id>
+ <posX>0</posX>
+ <posY>0</posY>
+ <width>720</width>
+ <height>576</height>
+ <texture>background.png</texture>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>11</id>
+ <posX>60</posX>
+ <posY>70</posY>
+ <label>Simon Say</label>
+ <font>font16</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>Start</description>
+ <type>button</type>
+ <id>2</id>
+ <posX>60</posX>
+ <posY>97</posY>
+ <label>Start</label>
+ <onleft>2</onleft>
+ <onright>2</onright>
+ <onup>6</onup>
+ <ondown>3</ondown>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>Level</description>
+ <type>button</type>
+ <id>3</id>
+ <posX>60</posX>
+ <posY>131</posY>
+ <label>Level: Amateur</label>
+ <onleft>3</onleft>
+ <onright>3</onright>
+ <onup>2</onup>
+ <ondown>6</ondown>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>4</id>
+ <posX>70</posX>
+ <posY>170</posY>
+ <label>#Round</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>4</id>
+ <posX>70</posX>
+ <posY>204</posY>
+ <label>#Player</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>Whatsthis</description>
+ <type>button</type>
+ <id>6</id>
+ <posX>60</posX>
+ <posY>233</posY>
+ <label>What's this?</label>
+ <onleft>6</onleft>
+ <onright>6</onright>
+ <onup>3</onup>
+ <ondown>2</ondown>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <type>button</type>
+ <id>101</id>
+ <posX>280</posX>
+ <posY>80</posY>
+ <width>150</width>
+ <height>150</height>
+ <textureFocus>#Senso1</textureFocus>
+ <textureNoFocus>#Senso1</textureNoFocus>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <type>button</type>
+ <id>102</id>
+ <posX>430</posX>
+ <posY>80</posY>
+ <width>150</width>
+ <height>150</height>
+ <textureFocus>#Senso2</textureFocus>
+ <textureNoFocus>#Senso2</textureNoFocus>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <type>button</type>
+ <id>103</id>
+ <posX>280</posX>
+ <posY>230</posY>
+ <width>150</width>
+ <height>150</height>
+ <textureFocus>#Senso3</textureFocus>
+ <textureNoFocus>#Senso3</textureNoFocus>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <type>button</type>
+ <id>104</id>
+ <posX>430</posX>
+ <posY>230</posY>
+ <width>150</width>
+ <height>150</height>
+ <textureFocus>#Senso4</textureFocus>
+ <textureNoFocus>#Senso4</textureNoFocus>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ </controls>
+</window>
Added: trunk/plugins/MySimon/Source/Skin/Sounds/MySimon_a.wav
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/MySimon/Source/Skin/Sounds/MySimon_a.wav
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/MySimon/Source/Skin/Sounds/MySimon_c.wav
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/MySimon/Source/Skin/Sounds/MySimon_c.wav
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/MySimon/Source/Skin/Sounds/MySimon_e.wav
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/MySimon/Source/Skin/Sounds/MySimon_e.wav
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/MySimon/Source/Skin/Sounds/MySimon_err.wav
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/MySimon/Source/Skin/Sounds/MySimon_err.wav
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/MySimon/Source/Skin/Sounds/MySimon_g.wav
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/MySimon/Source/Skin/Sounds/MySimon_g.wav
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/MySimon/Source/readme.txt
===================================================================
--- trunk/plugins/MySimon/Source/readme.txt (rev 0)
+++ trunk/plugins/MySimon/Source/readme.txt 2007-04-10 12:09:04 UTC (rev 311)
@@ -0,0 +1,52 @@
+Visit the forum
+http://forum.team-mediaportal.com/new_game_simon_say-t19473.html
+
+Simon Say V0.3.1
+----------------
+
+-added time display on skin
+-modify the skin a little
+-enable hover picture
+
+Simon Say V0.3
+--------------
+
+-Added the great design from Mikael S\xF6derstr\xF6m.
+
+Simon Say V0.2
+--------------
+
+Simon Say (Senso)
+
+-Changed the window ID
+-disable level selection during gameplay
+-added button help in "what's this"
+
+Have fun.
+
+Greetz
+kroko
+
+
+Simon Say V0.1
+--------------
+
+Simon Say (Senso)
+
+Initial release
+This nice game from MB as a MP version. You can play with
+
+- the mouse
+- remote color buttons
+- 1 2
+ 4 5 (action keys)
+
+Copy the plugin and skin files into your favorite skin folder.
+I had to adjust my remote a little in the setup. It was to sensitve.
+
+Planed feature: Highscores ?
+
+Have fun.
+
+Greetz
+kroko
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kro...@us...> - 2007-04-10 11:58:20
|
Revision: 310
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=310&view=rev
Author: kroko_koenig
Date: 2007-04-10 04:58:17 -0700 (Tue, 10 Apr 2007)
Log Message:
-----------
Initial Release
Added Paths:
-----------
trunk/plugins/My Hexxagon/Skin/
trunk/plugins/My Hexxagon/Skin/SimpleMP/
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx01.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx01F.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx02.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx02F.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx03.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx03F.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx04.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx04F.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx05.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx05F.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx06.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx06F.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx07.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx07F.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/hover_my hexxagon.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/MyHexxagon.xml
trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/
trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxDouble.wav
trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxMove.wav
trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxSelect.wav
trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxZap.wav
trunk/plugins/My Hexxagon/Source/
trunk/plugins/My Hexxagon/Source/MyHexxagon/
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.cs
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.csproj
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.xml
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/Properties/
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/Properties/AssemblyInfo.cs
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon.sln
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon.suo
trunk/plugins/My Hexxagon/hexxagon.jpg
trunk/plugins/My Hexxagon/readme.txt
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx01.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx01.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx01F.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx01F.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx02.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx02.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx02F.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx02F.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx03.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx03.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx03F.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx03F.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx04.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx04.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx04F.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx04F.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx05.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx05.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx05F.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx05F.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx06.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx06.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx06F.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx06F.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx07.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx07.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx07F.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx07F.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/hover_my hexxagon.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/hover_my hexxagon.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/MyHexxagon.xml
===================================================================
--- trunk/plugins/My Hexxagon/Skin/SimpleMP/MyHexxagon.xml (rev 0)
+++ trunk/plugins/My Hexxagon/Skin/SimpleMP/MyHexxagon.xml 2007-04-10 11:58:17 UTC (rev 310)
@@ -0,0 +1,179 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<window>
+ <id>1234711</id>
+ <defaultcontrol>2</defaultcontrol>
+ <allowoverlay>yes</allowoverlay>
+ <autohidetopbar>yes</autohidetopbar>
+ <controls>
+ <import>common.time.xml</import>
+ <control>
+ <description>Hexxagon label</description>
+ <type>label</type>
+ <posX>55</posX>
+ <posY>20</posY>
+ <align>left</align>
+ <font>font48</font>
+ <label>Hexxagon</label>
+ <textcolor>20ffffff</textcolor>
+ <id>1</id>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>BackGround</description>
+ <type>image</type>
+ <id>1</id>
+ <posX>0</posX>
+ <posY>0</posY>
+ <width>720</width>
+ <height>576</height>
+ <texture>background.png</texture>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>11</id>
+ <posX>250</posX>
+ <posY>70</posY>
+ <label>Hexxagon</label>
+ <font>font16</font>
+ <align>right</align>
+ <textcolor>ffffffff</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>Start</description>
+ <type>button</type>
+ <id>2</id>
+ <posX>60</posX>
+ <posY>97</posY>
+ <label>Start</label>
+ <onleft>2</onleft>
+ <onright>22</onright>
+ <onup>4</onup>
+ <ondown>3</ondown>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>Mode</description>
+ <type>button</type>
+ <id>3</id>
+ <posX>60</posX>
+ <posY>131</posY>
+ <label>Mode: Play vs Computer</label>
+ <onleft>3</onleft>
+ <onright>3</onright>
+ <onup>2</onup>
+ <ondown>4</ondown>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>Level</description>
+ <type>button</type>
+ <id>4</id>
+ <posX>60</posX>
+ <posY>165</posY>
+ <label>Level: Amateur</label>
+ <onleft>4</onleft>
+ <onright>4</onright>
+ <onup>3</onup>
+ <ondown>6</ondown>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>5</id>
+ <posX>70</posX>
+ <posY>204</posY>
+ <label>#Round</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>7</id>
+ <posX>70</posX>
+ <posY>238</posY>
+ <label>#Player</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>Whatsthis</description>
+ <type>button</type>
+ <id>6</id>
+ <posX>60</posX>
+ <posY>267</posY>
+ <label>What's this?</label>
+ <onleft>6</onleft>
+ <onright>6</onright>
+ <onup>3</onup>
+ <ondown>2</ondown>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>12</id>
+ <posX>70</posX>
+ <posY>310</posY>
+ <label>#Ply1.Count</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ff000000</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>13</id>
+ <posX>70</posX>
+ <posY>340</posY>
+ <label>#Ply2.Count</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>progress bar</description>
+ <type>progress</type>
+ <id>8</id>
+ <posX>100</posX>
+ <posY>310</posY>
+ <width>180</width>
+ <label>#Ply1.Percentage</label>
+ <visible>yes</visible>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>progress bar</description>
+ <type>progress</type>
+ <id>9</id>
+ <posX>100</posX>
+ <posY>340</posY>
+ <width>180</width>
+ <label>#Ply2.Percentage</label>
+ <visible>yes</visible>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ </controls>
+</window>
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxDouble.wav
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxDouble.wav
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxMove.wav
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxMove.wav
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxSelect.wav
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxSelect.wav
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxZap.wav
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxZap.wav
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.cs
===================================================================
--- trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.cs (rev 0)
+++ trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.cs 2007-04-10 11:58:17 UTC (rev 310)
@@ -0,0 +1,842 @@
+#region Copyright (C) 2005-2007 Team MediaPortal
+
+/*
+ * Copyright (C) 2005-2007 Team MediaPortal
+ * http://www.team-mediaportal.com
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows.Forms;
+using MediaPortal.GUI.Library;
+using MediaPortal.Dialogs;
+using MediaPortal.Util;
+
+namespace MediaPortal.GUI.MyHexxagon
+{
+ public class MyHexxagonGUI : GUIWindow, ISetupForm
+ {
+ #region SkinControl
+ [SkinControlAttribute(2)]
+ protected GUIButtonControl BtnStart = null;
+ [SkinControlAttribute(3)]
+ protected GUIButtonControl BtnMode = null;
+ [SkinControlAttribute(4)]
+ protected GUIButtonControl BtnLevel = null;
+ [SkinControlAttribute(6)]
+ protected GUIButtonControl BtnWhatsThis = null;
+
+ #endregion
+
+ #region Private variables
+
+ int ActPly = 0; // actual player
+ string Mode = "1p"; // one player
+ string Level = "Am"; // Choosen level
+
+ int player = 4; // constant player
+ int computer = 6; // constant computer
+
+ int wait = 0; // init wait timer for computer
+
+ // init board
+ int[] board = {0,0,0,0,0,0,0,0,0,0, // 0-9
+ 0,0,0,0,0,0,0,0,0,0, //10-19
+ 0,0,1,1,1,1,1,0,0,0, //20-29
+ 0,0,1,1,1,1,1,1,0,0, //30-39
+ 0,0,1,1,1,1,1,1,1,0, //40-49
+ 0,0,1,1,1,1,0,1,1,1, //50-59
+ 0,0,1,1,1,0,1,1,1,1, //60-69
+ 1,0,0,1,1,1,1,0,1,1, //70-79
+ 1,0,0,0,1,1,1,1,1,1, //80-89
+ 1,0,0,0,0,1,1,1,1,1, //90-99
+ 1,0,0,0,0,0,1,1,1,1, //100-109
+ 1,0,0,0,0,0,0,0,0,0, //110-119
+ 0,0,0,0,0,0,0,0,0,0, //120-129
+ 0,0,0}; //130-132
+
+ // distances for moves
+ int[] MoveDouble = { 10, 11, 1, -10, -11, -1 };
+ int[] MoveJump = { 9, 20, 21, 22, 12, 2, -9, -20, -21, -22, -12, -2 };
+
+ // last selected move
+ int lastHexx = 0;
+
+ // init counter
+ int cntPly1 = 0;
+ int cntPly2 = 0;
+ int round = 1;
+
+ // some help arrays for draw the board
+ int[] Draw = { 22, 32, 42, 52, 62, 73, 84, 95, 106 };
+ int[] DrawCnt = { 5, 6, 7, 8, 9, 8, 7, 6, 5 };
+
+ // values on the baord
+ // Off Double Jump On1 On1Select On2 On2Select
+ // 1 2 3 4 5 6 7
+
+ // game ticker for the computer
+ private System.Windows.Forms.Timer _Game = new System.Windows.Forms.Timer();
+
+ #endregion
+
+ #region ISetupForm Members
+
+ // Returns the name of the plugin which is shown in the plugin menu
+ public string PluginName()
+ {
+ return "My Hexxagon";
+ }
+
+ // Returns the description of the plugin is shown in the plugin menu
+ public string Description()
+ {
+ return "My Hexxagon";
+ }
+
+ // Returns the author of the plugin which is shown in the plugin menu
+ public string Author()
+ {
+ return "Mark Koenig (kroko)";
+ }
+
+ // show the setup dialog
+ public void ShowPlugin()
+ {
+ MessageBox.Show("Nothing to configure, this is just an example");
+ }
+
+ // Indicates whether plugin can be enabled/disabled
+ public bool CanEnable()
+ {
+ return true;
+ }
+
+ // get ID of windowplugin belonging to this setup
+ public int GetWindowId()
+ {
+ return 1234711;
+ }
+
+ // Indicates if plugin is enabled by default;
+ public bool DefaultEnabled()
+ {
+ return true;
+ }
+
+ // indicates if a plugin has its own setup screen
+ public bool HasSetup()
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// If the plugin should have its own button on the main menu of MediaPortal then it
+ /// should return true to this method, otherwise if it should not be on home
+ /// it should return false
+ /// </summary>
+ /// <param name="strButtonText">text the button should have</param>
+ /// <param name="strButtonImage">image for the button, or empty for default</param>
+ /// <param name="strButtonImageFocus">image for the button, or empty for default</param>
+ /// <param name="strPictureImage">subpicture for the button or empty for none</param>
+ /// <returns>true : plugin needs its own button on home
+ /// false : plugin does not need its own button on home</returns>
+
+ public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage)
+ {
+ strButtonText = PluginName();
+ strButtonImage = String.Empty;
+ strButtonImageFocus = String.Empty;
+ strPictureImage = @"hover_my hexxagon.png";
+ return true;
+ }
+
+ #endregion
+
+ public override int GetID
+ {
+ get
+ {
+ return 1234711;
+ }
+ set
+ {
+ base.GetID = value;
+ }
+ }
+
+ public override bool Init()
+ {
+ bool result = Load(GUIGraphicsContext.Skin + @"\MyHexxagon.xml");
+ return result;
+ }
+
+ public override bool OnMessage(GUIMessage message)
+ {
+ return base.OnMessage(message);
+ }
+
+ public void Dispose()
+ {
+ _Game.Stop();
+ _Game.Tick -= new EventHandler(_Game_Tick);
+ }
+
+ protected override void OnPageLoad()
+ {
+ // start game ticker
+ _Game.Interval = 100;
+ _Game.Tick += new EventHandler(_Game_Tick);
+ _Game.Start();
+
+ base.OnPageLoad();
+
+ // get position from the start button
+ int StartX = GetControl(BtnStart.GetID).XPosition;
+ int StartY = GetControl(BtnStart.GetID).YPosition;
+ int Width = GetControl(BtnStart.GetID).Width;
+
+ // calc the position of the hexxagon
+ StartX = StartX + Width + 10;
+ StartY = StartY + 100;
+
+ // draw buttons
+ for (int j = 0; j < 9; j++)
+ {
+ for (int i = 0; i < DrawCnt[j]; i++)
+ {
+
+ int Nr = Draw[j] + i;
+ int XPos = StartX + (j * 45);
+ int YPos = 0;
+
+ if (j < 5)
+ YPos = StartY + (i * 37) - (19 * j);
+
+ if (j > 4)
+ YPos = StartY + (i * 37) - (19 * (8 - j));
+
+ CreateButton(Nr, XPos, YPos, 40, 60, "#F" + Nr, "#NF" + Nr);
+
+ //default navigation
+ int up = Nr - 1;
+ int dn = Nr + 1;
+ int le = Nr - 10;
+ int ri = Nr + 10;
+
+ //make it easier to navigate
+ if (j == 0 || j == 2 || j == 4 || j == 6 || j == 8)
+ {
+ le = Nr - 11;
+ ri = Nr + 11;
+ }
+ //block to top
+ if (i == 0)
+ up = Nr;
+ //block to bottom
+ if (i == (DrawCnt[j]-1))
+ dn = Nr;
+ //goto to start on left side
+ if (j == 0)
+ le = 2;
+ //block to right
+ if (j == 8)
+ ri = Nr;
+ // some exeption top row
+ if (i==0)
+ {
+ if (j == 2 || j == 4)
+ {
+ le = Nr - 10;
+ }
+ if (j == 5 || j==7)
+ {
+ ri = Nr + 11 ;
+ }
+ }
+ // some exeption bottom row
+ if ((i==5 && j==1) || (i==7 && j==3))
+ le = Nr - 11;
+ if ((i==8 && j==4) || (i==6 && j==6))
+ ri = Nr + 10;
+
+ //SetNavigation(U, D, L, R)
+ GetControl(Nr).SetNavigation(up, dn, le, ri);
+
+ }
+ }
+
+ // Disable some buttons
+ GUIControl.DisableControl(GetID, 56);
+ GUIControl.DisableControl(GetID, 65);
+ GUIControl.DisableControl(GetID, 77);
+
+ // Draw field
+ UpdateBoard();
+ }
+
+ protected override void OnPageDestroy(int new_windowId)
+ {
+ _Game.Stop();
+ _Game.Tick -= new EventHandler(_Game_Tick);
+ }
+
+ protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
+ {
+ if (control == BtnWhatsThis)
+ OnBtnWhatsThis();
+ if (control == BtnStart)
+ {
+ ActPly = 4; // Player 1 starts
+ round = 1; // reset round counter
+
+ // clear board
+ for (int i = 22; i < 111; i++)
+ {
+ if (board[i] > 1)
+ board[i] = 1;
+ }
+
+ // Set first tokens
+ board[22] = 4;
+ board[70] = 4;
+ board[106] = 4;
+ board[26] = 6;
+ board[62] = 6;
+ board[110] = 6;
+
+ // reset score
+ cntPly1 = 3;
+ cntPly2 = 3;
+
+ // draw field
+ UpdateBoard();
+
+ }
+ if (control == BtnLevel)
+ OnBtnLevel();
+ if (control == BtnMode )
+ OnBtnMode();
+
+ // check if some has clicked
+ if (board[controlId] == ActPly)
+ {
+ if (ActPly == 4 || (ActPly == 6 && Mode=="2p"))
+ Select(ActPly, controlId);
+ }
+ if (board[controlId] == 2 || board[controlId] == 3)
+ Move(ActPly, controlId);
+ }
+
+ protected override void OnShowContextMenu()
+ {
+ base.OnShowContextMenu();
+ }
+
+ private void CreateButton(int ID, int posx, int posy, int height, int width, string focusimg, string nofocusimg)
+ {
+ GUIButtonControl button = new GUIButtonControl(GetID, ID, posx, posy, width, height, focusimg, nofocusimg);
+ button.AllocResources();
+ GUIControl btnControl = (GUIControl)button;
+ Add(ref btnControl);
+ }
+
+ void _Game_Tick(object sender, EventArgs e)
+ {
+ // wait some time
+ if (wait > 0)
+ wait = wait - 1;
+
+ if (wait == 0 && ActPly == computer)
+ {
+ if (Mode=="1p")
+ // move the computer
+ CompSelect();
+ }
+ }
+
+ private void UpdateBoard()
+ {
+ // draw the board
+ for (int i = 22; i < 111; i++)
+ {
+ if (board[i] == 1)
+ {
+ GUIPropertyManager.SetProperty("#F" + i, @"\Hexxagon\MyHexx01F.png");
+ GUIPropertyManager.SetProperty("#NF" + i, @"\Hexxagon\MyHexx01.png");
+ }
+ if (board[i] == 2)
+ {
+ GUIPropertyManager.SetProperty("#F" + i, @"\Hexxagon\MyHexx02F.png");
+ GUIPropertyManager.SetProperty("#NF" + i, @"\Hexxagon\MyHexx02.png");
+ }
+ if (board[i] == 3)
+ {
+ GUIPropertyManager.SetProperty("#F" + i, @"\Hexxagon\MyHexx03F.png");
+ GUIPropertyManager.SetProperty("#NF" + i, @"\Hexxagon\MyHexx03.png");
+ }
+ if (board[i] == 4)
+ {
+ GUIPropertyManager.SetProperty("#F" + i, @"\Hexxagon\MyHexx04F.png");
+ GUIPropertyManager.SetProperty("#NF" + i, @"\Hexxagon\MyHexx04.png");
+ }
+ if (board[i] == 5)
+ {
+ GUIPropertyManager.SetProperty("#F" + i, @"\Hexxagon\MyHexx05F.png");
+ GUIPropertyManager.SetProperty("#NF" + i, @"\Hexxagon\MyHexx05.png");
+ }
+ if (board[i] == 6)
+ {
+ GUIPropertyManager.SetProperty("#F" + i, @"\Hexxagon\MyHexx06F.png");
+ GUIPropertyManager.SetProperty("#NF" + i, @"\Hexxagon\MyHexx06.png");
+ }
+ if (board[i] == 7)
+ {
+ GUIPropertyManager.SetProperty("#F" + i, @"\Hexxagon\MyHexx07F.png");
+ GUIPropertyManager.SetProperty("#NF" + i, @"\Hexxagon\MyHexx07.png");
+ }
+ if (ActPly == 4)
+ GUIPropertyManager.SetProperty("#Player", "Player 1");
+ if (ActPly == 6)
+ GUIPropertyManager.SetProperty("#Player", "Player 2");
+ if (ActPly == 0)
+ GUIPropertyManager.SetProperty("#Player", "Game over");
+
+ // display counter and so on
+ GUIPropertyManager.SetProperty("#Round", "Round: 1");
+ GUIPropertyManager.SetProperty("#Ply1.Count", cntPly1.ToString());
+ GUIPropertyManager.SetProperty("#Ply2.Count", cntPly2.ToString());
+
+ int p1 = (100 * cntPly1 / 58);
+ int p2 = (100 * cntPly2 / 58);
+
+ GUIPropertyManager.SetProperty("#Ply1.Percentage", p1.ToString());
+ GUIPropertyManager.SetProperty("#Ply2.Percentage", p2.ToString());
+ GUIPropertyManager.SetProperty("#Round", "Round: " + round);
+ }
+ }
+
+ private void Select(int ply, int pos)
+ {
+ // not game over
+ if (ActPly != 0)
+ {
+ // remember selected pos
+ lastHexx = pos;
+ // reset old selection
+ for (int i = 22; i < 111; i++)
+ {
+ if (board[i] == 2)
+ board[i] = 1;
+ if (board[i] == 3)
+ board[i] = 1;
+ if (board[i] == 5)
+ board[i] = 4;
+ if (board[i] == 7)
+ board[i] = 6;
+ }
+ // display selected pos
+ board[pos] = ply + 1;
+ MediaPortal.Util.Utils.PlaySound("HexxSelect.wav", false, true);
+ // draw selection for double
+ for (int i = 0; i < 6; i++)
+ {
+ // if not occupied and visible
+ if (board[pos + MoveDouble[i]] == 1)
+ board[pos + MoveDouble[i]] = 2;
+ }
+ // draw selection for jumpe
+ for (int i = 0; i < 12; i++)
+ {
+ // if not occupied and visible
+ if (board[pos + MoveJump[i]] == 1)
+ board[pos + MoveJump[i]] = 3;
+ }
+ UpdateBoard();
+ }
+ }
+
+ private void Move(int ply, int pos)
+ {
+ if (board[pos] == 2)
+ {
+ // double
+ board[pos] = ply;
+ Check(ply, pos);
+ MediaPortal.Util.Utils.PlaySound("HexxDouble.wav", false, true);
+ }
+ if (board[pos] == 3)
+ {
+ // jump
+ board[lastHexx] = 1;
+ board[pos] = ply;
+ Check(ply, pos);
+ MediaPortal.Util.Utils.PlaySound("HexxMove.wav", false, true);
+ }
+ // clear selection on the board
+ for (int i = 22; i < 111; i++)
+ {
+ if (board[i] == 2)
+ board[i] = 1;
+ if (board[i] == 3)
+ board[i] = 1;
+ if (board[i] == 5)
+ board[i] = 4;
+ if (board[i] == 7)
+ board[i] = 6;
+ }
+
+ // reset last stored
+ lastHexx = 0;
+
+ NextPlayer();
+ UpdateBoard();
+
+ }
+
+ private void Check(int ply, int pos)
+ {
+ bool signal = false;
+
+ // after move turn arround all surrounding tokens
+ for (int i = 0; i < 6; i++)
+ {
+ int next = ply + 2;
+ if (next > 6) next = 4;
+
+ if (board[pos + MoveDouble[i]] == next)
+ {
+ board[pos + MoveDouble[i]] = ply;
+ signal = true;
+ }
+ }
+ }
+
+ private void NextPlayer()
+ {
+ if (ActPly == 4)
+ {
+ ActPly = 6;
+ wait = 25;
+ //CompSelect();
+ }
+ else
+ {
+ ActPly = 4;
+ round = round + 1;
+ }
+ // check if there is a move left
+ NoMove(ActPly);
+ }
+
+ private void NoMove(int ply)
+ {
+ bool noMove = true;
+
+ for (int i = 22; i < 111; i++)
+ { // there is a move possible
+ if (noMove == false)
+ break;
+
+ if (board[i] == ply)
+ { // if this is a player field
+ for (int j = 0; j < 6; j++)
+ { // check double fields are empty
+ if (board[i + MoveDouble[j]] == 1)
+ {
+ noMove = false;
+ break;
+ }
+ }
+ for (int j = 0; j < 12; j++)
+ { // check jump fields are empty
+ if (board[i + MoveJump[j]] == 1)
+ {
+ noMove = false;
+ break;
+ }
+ }
+ }
+
+ }
+
+ if (noMove == true)
+ { // Player can not move fill rest with other player
+
+ ActPly = 0; // Game over
+
+ int next = ply + 2;
+ if (next > 6) next = 4;
+
+ for (int i = 22; i < 111; i++)
+ {
+ if (board[i] == 1)
+ board[i] = next;
+
+ }
+ }
+
+ // set counter to 0
+ cntPly1 = 0;
+ cntPly2 = 0;
+ //count all fields
+ for (int j = 22; j < 111; j++)
+ {
+ if (board[j] == 4 || board[j] == 5)
+ cntPly1 = cntPly1 + 1;
+ if (board[j] == 6 || board[j] == 7)
+ cntPly2 = cntPly2 + 1;
+ }
+ UpdateBoard();
+
+ // set message for game over
+ string msg = "";
+ if ((ActPly == 0) && (cntPly1 > cntPly2))
+ {
+ msg="Player 1 wins the game !";
+ }
+ if((ActPly == 0) && (cntPly1 < cntPly2))
+ {
+ msg="Player 2 wins the game !";
+ }
+ if((ActPly == 0) && (cntPly1 == cntPly2))
+ {
+ msg="It is a tie !";
+ }
+ // if game over
+ if (msg != "")
+ {
+ GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK);
+ dlg.SetHeading(msg);
+ dlg.SetLine(1, msg);
+ dlg.SetLine(2, "Result");
+ dlg.SetLine(3, cntPly1.ToString() + " : " + cntPly2.ToString());
+ dlg.DoModal(GUIWindowManager.ActiveWindow);
+ }
+ }
+
+ private void CompSelect()
+ {
+ // search the best move
+ double[] thisBest = { 0, 0, 0, 0 };
+ double[] bestMove = { 0, 0, 0, 0 };
+
+ // check all fields
+ for (int i = 22; i < 111; i++)
+ {
+ int compHexx = 0;
+
+ // if field is computer
+ if (board[i]==computer)
+ compHexx = i;
+
+ if (compHexx != 0)
+ {
+ // Find the best move from every best move
+ thisBest = findBestMove(compHexx);
+
+ if (thisBest[0] > bestMove[0])
+ {
+ bestMove = thisBest;
+ } // Find best move if equal ranking
+ else if (thisBest[0] == bestMove[0])
+ {
+ if (thisBest[3] < bestMove[3])
+ {
+ bestMove = thisBest;
+ }
+ }
+ }
+ }
+
+ if (bestMove[2] != 0)
+ {
+ Select(computer, Convert.ToInt16(bestMove[1]));
+ Move(computer, Convert.ToInt16(bestMove[2]));
+ }
+
+ }
+
+ private double[] findBestMove(int compHexx)
+ {
+ double highestRanking = 0;
+ int hexxCheck = 0;
+ int hexxDest = 0;
+ int tryDest = 0;
+ double eqCount = 0;
+
+ Random randObj = new Random();
+
+ double [] returnArr = {0,0,0,0};
+
+ // calculate the value for selcted pos
+
+ for (int check = 0; check<3; check++)
+ {
+ for (int j = 0; j<6; j++)
+ {
+ double attackCount = 0;
+
+ if (check == 0)
+ {
+ // normal double
+ hexxCheck = MoveDouble[j];
+
+ double RND = Math.Round (randObj.NextDouble() * 1.5);
+ if (RND==1)
+ {
+ attackCount = 0.5;
+ }
+ else
+ {
+ attackCount = 1.5;
+ }
+ }
+ if (check == 1)
+ {
+ // jump part 1
+ hexxCheck = MoveJump[j];
+ }
+ if (check == 2)
+ {
+ // jump part 2
+ hexxCheck = MoveJump[j+6];
+ }
+
+ for (int k = 0; k<6; k++)
+ {
+ tryDest = compHexx + hexxCheck;
+ if (board[tryDest] == 1)
+ {
+ // If destination is not occupied...
+ if (board[tryDest+MoveDouble[k]] == player)
+ {
+ // Count attacks for each move
+ attackCount++;
+ }
+ }
+ }
+ if (attackCount>=highestRanking)
+ {
+ // Find the best available attacking move
+ if (board[tryDest] == 1)
+ {
+ highestRanking = attackCount;
+ hexxDest = tryDest;
+ }
+ }
+ // Find the better of two equally ranked moves
+ if (attackCount == highestRanking)
+ {
+ eqCount = 0;
+ for (int k = 0; k<6; k++)
+ {
+ if (board[compHexx + MoveDouble[k]] == computer)
+ {
+ // Only move if least of your kind surrounding you
+ eqCount++;
+ }
+ else
+ {
+ eqCount--;
+ }
+ }
+ }
+ }
+ }
+
+ // return values
+
+ returnArr[0] = highestRanking;
+ returnArr[1] = Convert.ToDouble(compHexx);
+ returnArr[2] = Convert.ToDouble(hexxDest);
+ returnArr[3] = eqCount;
+ return returnArr;
+ }
+
+ private void OnBtnWhatsThis()
+ {
+ GUIDialogText dlg = (GUIDialogText)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_TEXT);
+ dlg.SetHeading("What's Hexxagon");
+ dlg.SetText("Hexxagon is one of the most popular animated\n" +
+ "board games of strategy, loosely based upon\n" +
+ "Othello and Attaxx!. The original version was\n" +
+ "written in 1992 by Argo Games, and has been\n" +
+ "updated for the web by Neave. Finally I updated\n" +
+ "it for th MP.\n\n" +
+ "Game board design by Mikael S\xF6derstr\xF6m\n\n" +
+ "YOUR AIM: To take over the world! You can\n" +
+ "choose to play against the computer, or\n" +
+ "against another human opponent. There are\n" +
+ "two types of move, a jump or double, indicated\n" +
+ "hexxagon occupied by an opponent's piece will\n" +
+ "transform them into yours.\n\n" +
+ "Good luck\nkroko");
+ dlg.DoModal(GetID);
+ }
+
+ private void OnBtnLevel()
+ { //Choose level for the game
+ if (ActPly == 0 || (round==1 && ActPly == player ))
+ {
+ if (Level == "Nor")
+ {
+ GUIControl.SetControlLabel(GetID, BtnLevel.GetID, "Level: Professional");
+ Level = "Pro";
+ }
+ else if (Level == "Pro")
+ {
+ GUIControl.SetControlLabel(GetID, BtnLevel.GetID, "Level: Amateur");
+ Level = "Am";
+ }
+ else
+ {
+ GUIControl.SetControlLabel(GetID, BtnLevel.GetID, "Level: Normal");
+ Level = "Nor";
+ }
+ }
+ }
+
+ private void OnBtnMode()
+ { //Choose mode for the game
+ if (ActPly == 0 || (round == 1 && ActPly == player))
+ {
+ if (Mode == "2p")
+ {
+ GUIControl.SetControlLabel(GetID, BtnMode.GetID, "Mode: Play vs Computer");
+ Mode = "1p";
+ // Enable level selection
+ GUIControl.EnableControl(GetID, 4);
+ }
+ else
+ {
+ GUIControl.SetControlLabel(GetID, BtnMode.GetID, "Mode: Play vs Player");
+ Mode = "2p";
+ // Disable level selection
+ GUIControl.DisableControl(GetID, 4);
+ }
+ }
+ }
+
+ }
+
+}
\ No newline at end of file
Added: trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.csproj
===================================================================
--- trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.csproj (rev 0)
+++ trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.csproj 2007-04-10 11:58:17 UTC (rev 310)
@@ -0,0 +1,58 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{7446DF9E-4F6D-41BF-89EB-7CFA23FA1DCD}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>MyHexxagon</RootNamespace>
+ <AssemblyName>MyHexxagon</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>..\..\..\..\..\Programme\Team MediaPortal\MediaPortal\Plugins\Windows\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Core, Version=0.2.2.0, Culture=neutral, processorArchitecture=x86">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\..\..\..\Programme\Team MediaPortal\MediaPortal\Core.DLL</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=x86">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\..\..\..\Programme\Team MediaPortal\MediaPortal\Plugins\Windows\Dialogs.DLL</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="MyHexxagon.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
Added: trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.xml
===================================================================
--- trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.xml (rev 0)
+++ trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.xml 2007-04-10 11:58:17 UTC (rev 310)
@@ -0,0 +1,151 @@
+<window>
+ <id>1234711</id>
+ <defaultcontrol>2</defaultcontrol>
+ <allowoverlay>yes</allowoverlay>
+ <autohidetopbar>yes</autohidetopbar>
+ <controls>
+ <import>common.time.xml</import>
+ <control>
+ <description>BackGround</description>
+ <type>image</type>
+ <id>1</id>
+ <posX>0</posX>
+ <posY>0</posY>
+ <width>720</width>
+ <height>576</height>
+ <texture>background.png</texture>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>11</id>
+ <posX>60</posX>
+ <posY>70</posY>
+ <label>Hexxagon</label>
+ <font>font16</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>Start</description>
+ <type>button</type>
+ <id>2</id>
+ <posX>60</posX>
+ <posY>97</posY>
+ <label>Start</label>
+ <onleft>2</onleft>
+ <onright>2</onright>
+ <onup>6</onup>
+ <ondown>3</ondown>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>Level</description>
+ <type>button</type>
+ <id>3</id>
+ <posX>60</posX>
+ <posY>131</posY>
+ <label>Level: Amateur</label>
+ <onleft>3</onleft>
+ <onright>3</onright>
+ <onup>2</onup>
+ <ondown>6</ondown>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>4</id>
+ <posX>70</posX>
+ <posY>170</posY>
+ <label>#Round</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>4</id>
+ <posX>70</posX>
+ <posY>204</posY>
+ <label>#Player</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>Whatsthis</description>
+ <type>button</type>
+ <id>6</id>
+ <posX>60</posX>
+ <posY>233</posY>
+ <label>What's this?</label>
+ <onleft>6</onleft>
+ <onright>6</onright>
+ <onup>3</onup>
+ <ondown>2</ondown>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>12</id>
+ <posX>70</posX>
+ <posY>280</posY>
+ <label>#Ply1.Count</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ff000000</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>13</id>
+ <posX>70</posX>
+ <posY>310</posY>
+ <label>#Ply2.Count</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>progress bar</description>
+ <type>progress</type>
+ <id>8</id>
+ <posX>100</posX>
+ <posY>280</posY>
+ <width>180</width>
+ <label>#Ply1.Percentage</label>
+ <visible>yes</visible>
+ <animation effect="fade" time="250">WindowOpen</animation>
+ <animation effect="fade" time="500">WindowClose</animation>
+ </control>
+ <control>
+ <description>progress bar</description>
+ <type>progress</type>
+ <id>9</id>
+ <posX>100</posX>
+ <posY>310</posY>
+ <width>180</width>
+ <label>#Ply2.Percentage</label>
+ <visible>yes</visible>
+ <animation effect="fade" time="250">WindowOpen</animation>
+ <animation effect="fade" time="500">WindowClose</animation>
+ </control>
+ </controls>
+</window>
Added: trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/Properties/AssemblyInfo.cs
===================================================================
--- trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/Properties/AssemblyInfo.cs (rev 0)
+++ trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/Properties/AssemblyInfo.cs 2007-04-10 11:58:17 UTC (rev 310)
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// Allgemeine Informationen über eine Assembly werden über die folgenden
+// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
+// die mit einer Assembly verknüpft sind.
+[assembly: AssemblyTitle("MyHexxagon")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("MyHexxagon")]
+[assembly: AssemblyCopyright("Copyright © 2007")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
+// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
+// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
+[assembly: ComVisible(false)]
+
+// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
+[assembly: Guid("529d6960-1821-438c-90c9-8850e9fac04f")]
+
+// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
+//
+// Hauptversion
+// Nebenversion
+// Buildnummer
+// Revision
+//
+// Sie können alle Werte angeben oder die standardmäßigen Revisions- und Buildnummern
+// übernehmen, indem Sie "*" eingeben:
+[assembly: AssemblyVersion("0.1.0.0")]
+[assembly: AssemblyFileVersion("0.1.0.0")]
Added: trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon.sln
===================================================================
--- trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon.sln (rev 0)
+++ trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon.sln 2007-04-10 11:58:17 UTC (rev 310)
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyHexxagon", "MyHexxagon\MyHexxagon.csproj", "{7446DF9E-4F6D-41BF-89EB-7CFA23FA1DCD}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {7446DF9E-4F6D-41BF-89EB-7CFA23FA1DCD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7446DF9E-4F6D-41BF-89EB-7CFA23FA1DCD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7446DF9E-4F6D-41BF-89EB-7CFA23FA1DCD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7446DF9E-4F6D-41BF-89EB-7CFA23FA1DCD}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
Added: trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon.suo
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon.suo
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/hexxagon.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/hexxagon.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/readme.txt
===================================================================
--- trunk/plugins/My Hexxagon/readme.txt (rev 0)
+++ trunk/plugins/My Hexxagon/readme.txt 2007-04-10 11:58:17 UTC (rev 310)
@@ -0,0 +1,42 @@
+Visit the forum
+http://forum.team-mediaportal.com/hexxagon_game-t20507.html
+
+Hexxagon
+--------
+-Initial release
+-1 and 2 player support
+-Gameboard design by Mikael S\xF6derstr\xF6m for the SimpleMP
+
+This nice game from MB as a MP version. You can play with
+- the mouse
+- remote
+
+Copy the plugin and skin files into your favorite skin folder.
+It works also for the Blue Two Skin.
+
+
+Description:
+------------
+Hexxagon is one of the most popular animated
+board games of strategy, loosely based upon
+Othello and Attaxx!. The original version was
+written in 1992 by Argo Games, and has been
+updated for the web by Neave. Finally I updated
+it for th MP.
+Game board design by Mikael S\xF6derstr\xF6m
+YOUR AIM: To take over the world! You can
+choose to play against the computer, or
+against another human opponent. There are
+two types of move, a jump or double, indicated
+hexxagon occupied by an opponent's piece will
+transform them into yours.
+
+Good luck
+kroko
+
+
+
+Have fun.
+
+Greetz
+kroko
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kro...@us...> - 2007-04-10 11:56:17
|
Revision: 309
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=309&view=rev
Author: kroko_koenig
Date: 2007-04-10 04:56:12 -0700 (Tue, 10 Apr 2007)
Log Message:
-----------
Initial Release
Added Paths:
-----------
trunk/plugins/My Hexxagon/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kro...@us...> - 2007-04-10 11:55:39
|
Revision: 308
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=308&view=rev
Author: kroko_koenig
Date: 2007-04-10 04:55:38 -0700 (Tue, 10 Apr 2007)
Log Message:
-----------
Removed file/folder
Removed Paths:
-------------
trunk/Source/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kro...@us...> - 2007-04-10 11:55:32
|
Revision: 307
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=307&view=rev
Author: kroko_koenig
Date: 2007-04-10 04:55:31 -0700 (Tue, 10 Apr 2007)
Log Message:
-----------
Removed file/folder
Removed Paths:
-------------
trunk/Thumbs.db
Deleted: trunk/Thumbs.db
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kro...@us...> - 2007-04-10 11:55:27
|
Revision: 306
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=306&view=rev
Author: kroko_koenig
Date: 2007-04-10 04:55:24 -0700 (Tue, 10 Apr 2007)
Log Message:
-----------
Removed file/folder
Removed Paths:
-------------
trunk/readme.txt
Deleted: trunk/readme.txt
===================================================================
--- trunk/readme.txt 2007-04-10 11:55:17 UTC (rev 305)
+++ trunk/readme.txt 2007-04-10 11:55:24 UTC (rev 306)
@@ -1,21 +0,0 @@
-Visit the forum
-http://forum.team-mediaportal.com/new_game_connect_4_vier_gewinnt-t20442.html
-
-Connect 4 (Vier gewinnt)
-------------------------
--Initial release
--1 and 2 player support
--Gameboard design by Mikael S\xF6derstr\xF6m.
-
-This nice game from MB as a MP version. You can play with
-- the mouse
-- remote left/right and OK
-
-Copy the plugin and skin files into your favorite skin folder.
-I had to adjust my remote a little in the setup. It was to sensitve.
-
-
-Have fun.
-
-Greetz
-kroko
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kro...@us...> - 2007-04-10 11:55:20
|
Revision: 305
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=305&view=rev
Author: kroko_koenig
Date: 2007-04-10 04:55:17 -0700 (Tue, 10 Apr 2007)
Log Message:
-----------
Removed file/folder
Removed Paths:
-------------
trunk/Connect4.jpg
Deleted: trunk/Connect4.jpg
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kro...@us...> - 2007-04-10 11:55:12
|
Revision: 304
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=304&view=rev
Author: kroko_koenig
Date: 2007-04-10 04:55:06 -0700 (Tue, 10 Apr 2007)
Log Message:
-----------
Removed file/folder
Removed Paths:
-------------
trunk/Skin/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kro...@us...> - 2007-04-10 11:54:24
|
Revision: 303
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=303&view=rev
Author: kroko_koenig
Date: 2007-04-10 04:54:17 -0700 (Tue, 10 Apr 2007)
Log Message:
-----------
Initial release
Added Paths:
-----------
trunk/plugins/My Connect4/Connect4.jpg
trunk/plugins/My Connect4/Skin/
trunk/plugins/My Connect4/Skin/Media/
trunk/plugins/My Connect4/Skin/Media/MyConn4Cur.png
trunk/plugins/My Connect4/Skin/Media/MyConn4Gr.png
trunk/plugins/My Connect4/Skin/Media/MyConn4Rd.png
trunk/plugins/My Connect4/Skin/Media/MyConn4Wh.png
trunk/plugins/My Connect4/Skin/Media/MyConn4Ye.png
trunk/plugins/My Connect4/Skin/Media/MyConnBack.png
trunk/plugins/My Connect4/Skin/Media/hover_my connect4.png
trunk/plugins/My Connect4/Skin/MyConnect4.xml
trunk/plugins/My Connect4/Skin/Sounds/
trunk/plugins/My Connect4/Skin/Sounds/MyConnect4_klick.wav
trunk/plugins/My Connect4/Source/
trunk/plugins/My Connect4/Source/MyConnect4/
trunk/plugins/My Connect4/Source/MyConnect4/Engine.cs
trunk/plugins/My Connect4/Source/MyConnect4/MyConnect4.cs
trunk/plugins/My Connect4/Source/MyConnect4/MyConnect4.csproj
trunk/plugins/My Connect4/Source/MyConnect4/Properties/
trunk/plugins/My Connect4/Source/MyConnect4/Properties/AssemblyInfo.cs
trunk/plugins/My Connect4/Source/MyConnect4/State.cs
trunk/plugins/My Connect4/Source/MyConnect4.sln
trunk/plugins/My Connect4/Source/MyConnect4.suo
trunk/plugins/My Connect4/Thumbs.db
trunk/plugins/My Connect4/readme.txt
Added: trunk/plugins/My Connect4/Connect4.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Connect4/Connect4.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Connect4/Skin/Media/MyConn4Cur.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Connect4/Skin/Media/MyConn4Cur.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Connect4/Skin/Media/MyConn4Gr.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Connect4/Skin/Media/MyConn4Gr.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Connect4/Skin/Media/MyConn4Rd.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Connect4/Skin/Media/MyConn4Rd.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Connect4/Skin/Media/MyConn4Wh.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Connect4/Skin/Media/MyConn4Wh.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Connect4/Skin/Media/MyConn4Ye.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Connect4/Skin/Media/MyConn4Ye.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Connect4/Skin/Media/MyConnBack.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Connect4/Skin/Media/MyConnBack.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Connect4/Skin/Media/hover_my connect4.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Connect4/Skin/Media/hover_my connect4.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Connect4/Skin/MyConnect4.xml
===================================================================
--- trunk/plugins/My Connect4/Skin/MyConnect4.xml (rev 0)
+++ trunk/plugins/My Connect4/Skin/MyConnect4.xml 2007-04-10 11:54:17 UTC (rev 303)
@@ -0,0 +1,604 @@
+<window>
+ <id>22031969</id>
+ <defaultcontrol>2</defaultcontrol>
+ <allowoverlay>yes</allowoverlay>
+ <autohidetopbar>yes</autohidetopbar>
+ <controls>
+ <import>common.time.xml</import>
+ <control>
+ <description>BackGround</description>
+ <type>image</type>
+ <id>10</id>
+ <posX>0</posX>
+ <posY>0</posY>
+ <width>720</width>
+ <height>576</height>
+ <texture>background.png</texture>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>11</id>
+ <posX>60</posX>
+ <posY>70</posY>
+ <label>Connect 4</label>
+ <font>font16</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <type>group</type>
+ <description>group element</description>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ <control>
+ <description>Start</description>
+ <type>button</type>
+ <id>2</id>
+ <posX>60</posX>
+ <posY>97</posY>
+ <label>Start</label>
+ <onleft>2</onleft>
+ <onright>301</onright>
+ <onup>7</onup>
+ <ondown>3</ondown>
+ </control>
+ <control>
+ <description>Mode</description>
+ <type>button</type>
+ <id>3</id>
+ <posX>60</posX>
+ <posY>131</posY>
+ <label>Mode: Play vs Player</label>
+ <onleft>3</onleft>
+ <onright>3</onright>
+ <onup>2</onup>
+ <ondown>4</ondown>
+ </control>
+ <control>
+ <description>Level</description>
+ <type>button</type>
+ <id>4</id>
+ <posX>60</posX>
+ <posY>165</posY>
+ <label>Level: Amateur</label>
+ <onleft>4</onleft>
+ <onright>4</onright>
+ <onup>3</onup>
+ <ondown>7</ondown>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>5</id>
+ <posX>70</posX>
+ <posY>205</posY>
+ <label>#Round</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>6</id>
+ <posX>70</posX>
+ <posY>240</posY>
+ <label>#Player</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ </control>
+ <control>
+ <description>Whatsthis</description>
+ <type>button</type>
+ <id>7</id>
+ <posX>60</posX>
+ <posY>270</posY>
+ <label>What's this?</label>
+ <onleft>7</onleft>
+ <onright>301</onright>
+ <onup>4</onup>
+ <ondown>2</ondown>
+ </control>
+ </control>
+ <control>
+ <description>BackGround Game</description>
+ <type>image</type>
+ <id>15</id>
+ <posX>260</posX>
+ <posY>120</posY>
+ <width>440</width>
+ <height>380</height>
+ <texture>MyConnBack.png</texture>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <type>group</type>
+ <description>group element</description>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ <control>
+ <type>image</type>
+ <id>101</id>
+ <posX>280</posX>
+ <posY>140</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_1_1</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>102</id>
+ <posX>340</posX>
+ <posY>140</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_1_2</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>103</id>
+ <posX>400</posX>
+ <posY>140</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_1_3</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>104</id>
+ <posX>460</posX>
+ <posY>140</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_1_4</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>105</id>
+ <posX>520</posX>
+ <posY>140</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_1_5</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>106</id>
+ <posX>580</posX>
+ <posY>140</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_1_6</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>107</id>
+ <posX>640</posX>
+ <posY>140</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_1_7</texture>
+ </control>
+
+ <control>
+ <type>image</type>
+ <id>111</id>
+ <posX>280</posX>
+ <posY>200</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_2_1</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>112</id>
+ <posX>340</posX>
+ <posY>200</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_2_2</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>113</id>
+ <posX>400</posX>
+ <posY>200</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_2_3</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>114</id>
+ <posX>460</posX>
+ <posY>200</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_2_4</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>115</id>
+ <posX>520</posX>
+ <posY>200</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_2_5</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>116</id>
+ <posX>580</posX>
+ <posY>200</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_2_6</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>117</id>
+ <posX>640</posX>
+ <posY>200</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_2_7</texture>
+ </control>
+
+ <control>
+ <type>image</type>
+ <id>121</id>
+ <posX>280</posX>
+ <posY>260</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_3_1</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>122</id>
+ <posX>340</posX>
+ <posY>260</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_3_2</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>123</id>
+ <posX>400</posX>
+ <posY>260</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_3_3</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>124</id>
+ <posX>460</posX>
+ <posY>260</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_3_4</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>125</id>
+ <posX>520</posX>
+ <posY>260</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_3_5</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>126</id>
+ <posX>580</posX>
+ <posY>260</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_3_6</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>127</id>
+ <posX>640</posX>
+ <posY>260</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_3_7</texture>
+ </control>
+
+ <control>
+ <type>image</type>
+ <id>131</id>
+ <posX>280</posX>
+ <posY>320</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_4_1</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>132</id>
+ <posX>340</posX>
+ <posY>320</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_4_2</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>133</id>
+ <posX>400</posX>
+ <posY>320</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_4_3</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>134</id>
+ <posX>460</posX>
+ <posY>320</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_4_4</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>135</id>
+ <posX>520</posX>
+ <posY>320</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_4_5</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>136</id>
+ <posX>580</posX>
+ <posY>320</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_4_6</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>137</id>
+ <posX>640</posX>
+ <posY>320</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_4_7</texture>
+ </control>
+
+ <control>
+ <type>image</type>
+ <id>141</id>
+ <posX>280</posX>
+ <posY>380</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_5_1</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>142</id>
+ <posX>340</posX>
+ <posY>380</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_5_2</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>143</id>
+ <posX>400</posX>
+ <posY>380</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_5_3</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>144</id>
+ <posX>460</posX>
+ <posY>380</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_5_4</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>145</id>
+ <posX>520</posX>
+ <posY>380</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_5_5</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>146</id>
+ <posX>580</posX>
+ <posY>380</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_5_6</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>147</id>
+ <posX>640</posX>
+ <posY>380</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_5_7</texture>
+ </control>
+
+ <control>
+ <type>image</type>
+ <id>151</id>
+ <posX>280</posX>
+ <posY>440</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_6_1</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>152</id>
+ <posX>340</posX>
+ <posY>440</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_6_2</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>153</id>
+ <posX>400</posX>
+ <posY>440</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_6_3</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>154</id>
+ <posX>460</posX>
+ <posY>440</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_6_4</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>155</id>
+ <posX>520</posX>
+ <posY>440</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_6_5</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>156</id>
+ <posX>580</posX>
+ <posY>440</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_6_6</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>157</id>
+ <posX>640</posX>
+ <posY>440</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_6_7</texture>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>18</id>
+ <posX>260</posX>
+ <posY>510</posY>
+ <label>#Status</label>
+ <font>font16</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ </control>
+ <control>
+ <description>Pointer 01</description>
+ <type>button</type>
+ <id>301</id>
+ <posX>280</posX>
+ <posY>70</posY>
+ <width>40</width>
+ <height>40</height>
+ <onleft>2</onleft>
+ <onright>302</onright>
+ <textureFocus>MyConn4Cur.png</textureFocus>
+ </control>
+ <control>
+ <description>Pointer 02</description>
+ <type>button</type>
+ <id>302</id>
+ <posX>340</posX>
+ <posY>70</posY>
+ <width>40</width>
+ <height>40</height>
+ <onleft>301</onleft>
+ <onright>303</onright>
+ <textureFocus>MyConn4Cur.png</textureFocus>
+ </control>
+ <control>
+ <description>Pointer 03</description>
+ <type>button</type>
+ <id>303</id>
+ <posX>400</posX>
+ <posY>70</posY>
+ <width>40</width>
+ <height>40</height>
+ <onleft>302</onleft>
+ <onright>304</onright>
+ <textureFocus>MyConn4Cur.png</textureFocus>
+ </control>
+ <control>
+ <description>Pointer 04</description>
+ <type>button</type>
+ <id>304</id>
+ <posX>460</posX>
+ <posY>70</posY>
+ <width>40</width>
+ <height>40</height>
+ <onleft>303</onleft>
+ <onright>305</onright>
+ <textureFocus>MyConn4Cur.png</textureFocus>
+ </control>
+ <control>
+ <description>Pointer 05</description>
+ <type>button</type>
+ <id>305</id>
+ <posX>520</posX>
+ <posY>70</posY>
+ <width>40</width>
+ <height>40</height>
+ <onleft>304</onleft>
+ <onright>306</onright>
+ <textureFocus>MyConn4Cur.png</textureFocus>
+ </control>
+ <control>
+ <description>Pointer 06</description>
+ <type>button</type>
+ <id>306</id>
+ <posX>580</posX>
+ <posY>70</posY>
+ <width>40</width>
+ <height>40</height>
+ <onleft>305</onleft>
+ <onright>307</onright>
+ <textureFocus>MyConn4Cur.png</textureFocus>
+ </control>
+ <control>
+ <description>Pointer 07</description>
+ <type>button</type>
+ <id>307</id>
+ <posX>640</posX>
+ <posY>70</posY>
+ <width>40</width>
+ <height>40</height>
+ <onleft>306</onleft>
+ <onright>307</onright>
+ <textureFocus>MyConn4Cur.png</textureFocus>
+ </control>
+ </control>
+ </controls>
+</window>
Added: trunk/plugins/My Connect4/Skin/Sounds/MyConnect4_klick.wav
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Connect4/Skin/Sounds/MyConnect4_klick.wav
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Connect4/Source/MyConnect4/Engine.cs
===================================================================
--- trunk/plugins/My Connect4/Source/MyConnect4/Engine.cs (rev 0)
+++ trunk/plugins/My Connect4/Source/MyConnect4/Engine.cs 2007-04-10 11:54:17 UTC (rev 303)
@@ -0,0 +1,116 @@
+using System;
+using System.Drawing;
+
+namespace MediaPortal.GUI.MyConnect
+{
+ /// <summary>
+ /// Engine class handles the maintenance of player positions
+ /// on the game board and determines winning sequences of tokens.
+ /// </summary>
+ public class Engine
+ {
+ private static Random rand = new Random(System.DateTime.Now.Millisecond);
+ public State state;
+
+ public Engine(int w, int h, int n)
+ {
+ state = new State(w, h, n);
+ }
+
+ public State getState()
+ {
+ return state;
+ }
+ // drop a 'player' piece in column 'x'
+
+ public Point makeMove(int player, int xPos)
+ {
+ int yPos = state.dropPiece(player, xPos);
+ return (new Point(xPos, yPos));
+ }
+
+ // AI algorithm
+
+ public Point computerMove(int player, int level)
+ {
+ int bestXPos = -1, goodness = 0, bestWorst = -30000;
+ int numOfEqual = 0;
+
+ // Simulate a drop in each of the columns
+
+ for (int i = 0; i < state.getW(); i++)
+ {
+ State tempState = new State
+ (state, state.getW(), state.getH(), state.getN());
+
+ // If column is full, move on to the next column
+
+ if (tempState.dropPiece(player, i) < 0)
+ continue;
+
+ // If this drop wins the game, then cool
+
+ if (tempState.isWinner(player))
+ {
+ bestWorst = 25000;
+ bestXPos = i;
+ }
+
+ // If its not a winner, run evaluate algorithm 'level' times
+ // to find the best column to drop into. IE level 2 will
+ // look Columns x 2 drops into the future... etc etc.
+
+ else
+ goodness = tempState.evaluate(player, level, 1, -30000,
+ -bestWorst);
+
+ // If this move looks better than the previous move remember it
+
+ if (goodness > bestWorst)
+ {
+ bestWorst = goodness;
+ bestXPos = i;
+ numOfEqual = 1;
+ }
+
+ // If two moves are equally good, make a random choice
+
+ if (goodness == bestWorst)
+ {
+ numOfEqual++;
+ if (Math.Abs(rand.NextDouble()) % 10000 <
+ (10000 / numOfEqual))
+ bestXPos = i;
+ }
+ }
+
+ // Drop the piece in the best column
+
+ if (bestXPos >= 0)
+ {
+ int yPos = state.dropPiece(player, bestXPos);
+ if (yPos >= 0)
+ return (new Point(bestXPos, yPos));
+ }
+ return new Point(-1,-1);
+ }
+
+ // returns the state of the current gameboard
+
+ public int[,] getBoard()
+ {
+ return state.board;
+ }
+
+ public bool isWinner(int player)
+ {
+ return state.isWinner(player);
+ }
+
+ public bool isTie()
+ {
+ return state.isTie();
+ }
+ }
+}
+
Added: trunk/plugins/My Connect4/Source/MyConnect4/MyConnect4.cs
===================================================================
--- trunk/plugins/My Connect4/Source/MyConnect4/MyConnect4.cs (rev 0)
+++ trunk/plugins/My Connect4/Source/MyConnect4/MyConnect4.cs 2007-04-10 11:54:17 UTC (rev 303)
@@ -0,0 +1,480 @@
+#region Copyright (C) 2005-2007 Team MediaPortal
+
+/*
+ * Copyright (C) 2005-2007 Team MediaPortal
+ * http://www.team-mediaportal.com
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows.Forms;
+using System.Drawing;
+using MediaPortal.GUI.Library;
+using MediaPortal.Dialogs;
+using MediaPortal.Util;
+using MediaPortal.Utils;
+
+namespace MediaPortal.GUI.MyConnect
+{
+ public class MyConnect4GUI : GUIWindow , ISetupForm
+ {
+ #region SkinControl
+ [SkinControlAttribute(2)] protected GUIButtonControl BtnStart = null;
+ [SkinControlAttribute(4)] protected GUIButtonControl BtnLevel = null;
+ [SkinControlAttribute(3)] protected GUIButtonControl BtnMode = null;
+
+ [SkinControlAttribute(7)] protected GUIButtonControl BtnWhatsThis = null;
+ #endregion
+
+ #region Private variables
+
+ string Level="Am"; //Choosen level
+ int AI = 3;
+
+ string Mode = "2p"; //2player
+
+ int Player = 0;
+ int round = 0;
+
+ int wait = 0;
+
+ private static OnActionHandler ah;
+
+ private System.Windows.Forms.Timer _Game = new System.Windows.Forms.Timer();
+
+ private Engine gameEngine;
+
+ #endregion
+
+ #region ISetupForm Members
+
+ // Returns the name of the plugin which is shown in the plugin menu
+ public string PluginName()
+ {
+ return "My Connect 4";
+ }
+
+ // Returns the description of the plugin is shown in the plugin menu
+ public string Description()
+ {
+ return "Connect 4";
+ }
+
+ // Returns the author of the plugin which is shown in the plugin menu
+ public string Author()
+ {
+ return "Mark Koenig (kroko)";
+ }
+
+ // show the setup dialog
+ public void ShowPlugin()
+ {
+ MessageBox.Show("Nothing to configure, this is just an example");
+ }
+
+ // Indicates whether plugin can be enabled/disabled
+ public bool CanEnable()
+ {
+ return true;
+ }
+
+ // get ID of windowplugin belonging to this setup
+ public int GetWindowId()
+ {
+ return 22031969;
+ }
+
+ // Indicates if plugin is enabled by default;
+ public bool DefaultEnabled()
+ {
+ return true;
+ }
+
+ // indicates if a plugin has its own setup screen
+ public bool HasSetup()
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// If the plugin should have its own button on the main menu of MediaPortal then it
+ /// should return true to this method, otherwise if it should not be on home
+ /// it should return false
+ /// </summary>
+ /// <param name="strButtonText">text the button should have</param>
+ /// <param name="strButtonImage">image for the button, or empty for default</param>
+ /// <param name="strButtonImageFocus">image for the button, or empty for default</param>
+ /// <param name="strPictureImage">subpicture for the button or empty for none</param>
+ /// <returns>true : plugin needs its own button on home
+ /// false : plugin does not need its own button on home</returns>
+
+ public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage)
+ {
+ strButtonText = PluginName();
+ strButtonImage = String.Empty;
+ strButtonImageFocus = String.Empty;
+ strPictureImage = "hover_my connect4.png";
+ return true;
+ }
+
+ #endregion
+
+ public override int GetID
+ {
+ get
+ {
+ return 22031969;
+ }
+ set
+ {
+ base.GetID = value;
+ }
+ }
+
+ public override bool Init()
+ {
+ bool result = Load(GUIGraphicsContext.Skin + @"\MyConnect4.xml");
+ if (ah == null) ah = new OnActionHandler(OnAction2);
+ return result;
+ }
+
+ #region Actions
+ public override void OnAction(Action action)
+ {
+ base.OnAction(action);
+ }
+ public void OnAction2(Action action)
+ {
+
+ if (GUIWindowManager.ActiveWindowEx == (int)GUIWindow.Window.WINDOW_DIALOG_MENU) return;
+
+ //string t = action.wID.ToString();
+ //GUIPropertyManager.SetProperty("#Round", t);
+
+ if ((Player == 1) | (Player == 2 && Mode == "2p"))
+ {
+ switch (action.wID)
+ {
+ case Action.ActionType.ACTION_MOVE_LEFT:
+
+ break;
+ case Action.ActionType.ACTION_MOVE_RIGHT :
+
+ break;
+ case Action.ActionType.ACTION_SELECT_ITEM :
+
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ #endregion
+
+ public override bool OnMessage(GUIMessage message)
+ {
+ return base.OnMessage(message);
+ }
+
+ public void Dispose()
+ {
+ _Game.Stop();
+ _Game.Tick -= new EventHandler(_Game_Tick);
+ }
+
+ protected override void OnPageLoad()
+ {
+ _Game.Interval = 300;
+ _Game.Tick += new EventHandler(_Game_Tick);
+ _Game.Start();
+
+ Player = 0;
+ Level = "Am";
+ Mode = "2p";
+ AI = 3;
+
+ GUIPropertyManager.SetProperty("#Status", " ");
+ GUIControl.SetControlLabel(GetID, BtnLevel.GetID, "Level: Amateur");
+
+ // Disable level selection
+ GUIControl.DisableControl(GetID, 4);
+
+ RelButtons();
+
+ GUIGraphicsContext.OnNewAction -= ah;
+ GUIGraphicsContext.OnNewAction += ah;
+
+ base.OnPageLoad();
+
+ this.gameEngine = null;
+ this.gameEngine = new Engine(7, 6, 4);
+
+ Drawfield ();
+
+ }
+
+ protected override void OnPageDestroy(int new_windowId)
+ {
+ _Game.Stop();
+ _Game.Tick -= new EventHandler(_Game_Tick);
+ }
+
+ protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
+ {
+ if (control == BtnLevel)
+ OnBtnLevel();
+ if (control == BtnMode)
+ OnBtnMode();
+ if (control == BtnWhatsThis)
+ OnBtnWhatsThis();
+ if (control == BtnStart)
+ { //start game
+
+ if (Player == 0 && wait==0)
+ {
+ Player = 1;
+ round = 0;
+ GUIPropertyManager.SetProperty("#Status", " ");
+
+ // Disable start button
+ GUIControl.DisableControl(GetID, 2);
+ // Disable level selection
+ GUIControl.DisableControl(GetID, 3);
+ // Disable mode selection
+ GUIControl.DisableControl(GetID, 4);
+
+ this.gameEngine = null;
+ this.gameEngine = new Engine(7, 6, 4);
+
+ Drawfield();
+
+ wait = 2;
+ GUIControl.FocusControl(GetID, 15);
+ }
+ }
+ if ((Player==1)|(Player==2 && Mode=="2p"))
+ {
+
+ if ((controlId >= 301) && (controlId <= 307))
+ {
+ //which button has clicked ?
+ int col = controlId - 301;
+
+ PlayerClick(col);
+ wait = 2;
+ }
+ }
+ base.OnClicked(controlId, control, actionType);
+ }
+
+ protected override void OnShowContextMenu()
+ {
+ base.OnShowContextMenu();
+ }
+
+ private void OnBtnLevel()
+ { //Choose level for the game
+ if (Player==0)
+ {
+ if (Level == "Nor")
+ {
+ GUIControl.SetControlLabel(GetID, BtnLevel.GetID, "Level: Professional");
+ Level = "Pro";
+ AI = 7;
+ }
+ else if (Level == "Pro")
+ {
+ GUIControl.SetControlLabel(GetID, BtnLevel.GetID, "Level: Amateur");
+ Level = "Am";
+ AI = 3;
+ }
+ else
+ {
+ GUIControl.SetControlLabel(GetID, BtnLevel.GetID, "Level: Normal");
+ Level = "Nor";
+ AI = 5;
+ }
+ }
+ }
+
+ private void OnBtnMode()
+ { //Choose mode for the game
+ if (Player == 0)
+ {
+ if (Mode == "2p")
+ {
+ GUIControl.SetControlLabel(GetID, BtnMode.GetID, "Mode: Play vs Computer");
+ Mode = "1p";
+ // Enable level selection
+ GUIControl.EnableControl(GetID, 4);
+ }
+ else
+ {
+ GUIControl.SetControlLabel(GetID, BtnMode.GetID, "Mode: Play vs Player");
+ Mode = "2p";
+ // Disable level selection
+ GUIControl.DisableControl(GetID, 4);
+ }
+ }
+ }
+
+ private void OnBtnWhatsThis()
+ {
+ GUIDialogText dlg = (GUIDialogText)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_TEXT);
+ dlg.SetHeading("What's Connect 4 (Vier gewinnt)");
+ dlg.SetText("Connect 4 is a game where your object is to get 4 tokens in a row.\n" +
+ "This could be vertically, horizontal or diagonally.\n\n" +
+ "Gameboard design by Mikael S\xF6derstr\xF6m.\n\n" +
+ "AI code has been taken from http://www.Planet-Source-Code.com\n\n" +
+ "Good luck\nkroko");
+ dlg.DoModal(GetID);
+ }
+
+ private void Drawfield()
+ { // draw all fields
+
+ int[,] Myboard = gameEngine.getBoard();
+
+ for (int i = 0; i < 7; i++)
+ {
+ for (int j = 0; j < 6; j++)
+ {
+ string prop = "#Con_" + (6-j) + "_" + (i+1);
+
+ if (Myboard[i, j] == 2)
+ GUIPropertyManager.SetProperty(prop, "MyConn4Wh.png");
+ if (Myboard[i, j] == 0)
+ GUIPropertyManager.SetProperty(prop, "MyConn4Ye.png");
+ if (Myboard[i, j] == 1)
+ GUIPropertyManager.SetProperty(prop, "MyConn4Rd.png");
+ if (Myboard[i, j] > 2)
+ GUIPropertyManager.SetProperty(prop, "MyConn4Gr.png");
+ }
+ }
+ }
+
+ private void PlayerClick(int droppos)
+ {
+ Point pos = gameEngine.makeMove(Player - 1, droppos);
+ if (pos.Y >= 0)
+ {
+ round++;
+ Drawfield();
+ MediaPortal.Util.Utils.PlaySound("MyConnect4_klick.wav", false, true);
+
+
+ if (gameEngine.isWinner(Player - 1) == true)
+ {
+ int tmp = Player;
+ GUIPropertyManager.SetProperty("#Status", "Player " + tmp + " wins the game !");
+ Player = 0;
+ RelButtons();
+ gameEngine.getState().flashit(3);
+ Drawfield();
+ }
+ if (gameEngine.isTie() == true)
+ {
+ GUIPropertyManager.SetProperty("#Status", "Nobody wins the game ! Its a draw !");
+ Player = 0;
+ RelButtons();
+ GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK);
+ }
+ NextPlayer();
+ }
+
+ Drawfield();
+ }
+
+ private void NextPlayer()
+ {
+ if (Player != 0)
+ {
+ Player = Player + 1;
+ if (Player > 2)
+ Player = 1;
+ }
+ }
+
+ private void RelButtons()
+ {
+ // Enable start button
+ GUIControl.EnableControl(GetID, 2);
+ // Enable mode selection
+ GUIControl.EnableControl(GetID, 3);
+ if (Mode == "1p") // Enable level selection
+ GUIControl.EnableControl(GetID, 4);
+ // Enable What this
+ GUIControl.EnableControl(GetID, 7);
+
+ GUIControl.FocusControl(GetID, 2);
+ }
+
+ void _Game_Tick(object sender, EventArgs e)
+ {
+ //display status of the game
+ if (Player == 0)
+ GUIPropertyManager.SetProperty("#Player", "GAME OVER");
+ if (Player == 1)
+ GUIPropertyManager.SetProperty("#Player", "PLAYER 1");
+ if (Player == 2)
+ GUIPropertyManager.SetProperty("#Player", "PLAYER 2");
+ GUIPropertyManager.SetProperty("#Round", "Round: " + round );
+ //wait time
+ if (wait > 0)
+ {
+ wait = wait - 1;
+ }
+
+ if (Player == 2 && Mode == "1p" && wait==0)
+ {
+ Point pos = gameEngine.computerMove(1, AI);
+ if (pos.Y >= 0)
+ {
+ wait = 2;
+ round++;
+ Drawfield();
+ MediaPortal.Util.Utils.PlaySound("MyConnect4_klick.wav", false, true);
+
+
+ if (gameEngine.isWinner(Player - 1) == true)
+ {
+ GUIPropertyManager.SetProperty("#Status", "Player 2 wins the game !");
+ gameEngine.getState().flashit(3);
+ Drawfield();
+ Player = 0;
+ RelButtons();
+ }
+ if (gameEngine.isTie() == true)
+ {
+ GUIPropertyManager.SetProperty("#Status", "Nobody wins the game ! Its a draw !");
+ Player = 0;
+ RelButtons();
+ }
+ NextPlayer();
+ }
+ Drawfield();
+
+ }
+ }
+
+ }
+}
Added: trunk/plugins/My Connect4/Source/MyConnect4/MyConnect4.csproj
===================================================================
--- trunk/plugins/My Connect4/Source/MyConnect4/MyConnect4.csproj (rev 0)
+++ trunk/plugins/My Connect4/Source/MyConnect4/MyConnect4.csproj 2007-04-10 11:54:17 UTC (rev 303)
@@ -0,0 +1,54 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{7D1DBAFA-199A-47D9-A19C-9FCBA4B3F1EA}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>MyConnect4</RootNamespace>
+ <AssemblyName>MyConnect4</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Core, Version=1.0.2593.1921, Culture=neutral, processorArchitecture=MSIL" />
+ <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ <Reference Include="Utils, Version=1.0.2593.1896, Culture=neutral, processorArchitecture=MSIL" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Engine.cs" />
+ <Compile Include="MyConnect4.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="State.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
Added: trunk/plugins/My Connect4/Source/MyConnect4/Properties/AssemblyInfo.cs
===================================================================
--- trunk/plugins/My Connect4/Source/MyConnect4/Properties/AssemblyInfo.cs (rev 0)
+++ trunk/plugins/My Connect4/Source/MyConnect4/Properties/AssemblyInfo.cs 2007-04-10 11:54:17 UTC (rev 303)
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// Allgemeine Informationen über eine Assembly werden über die folgenden
+// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
+// die mit einer Assembly verknüpft sind.
+[assembly: AssemblyTitle("MyConnect4")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("MyConnect4")]
+[assembly: AssemblyCopyright("Copyright © 2007")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
+// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
+// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
+[assembly: ComVisible(false)]
+
+// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
+[assembly: Guid("9c36c885-c7f8-460a-a4bf-4b1893faf9bf")]
+
+// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
+//
+// Hauptversion
+// Nebenversion
+// Buildnummer
+// Revision
+//
+// Sie können alle Werte angeben oder die standardmäßigen Revisions- und Buildnummern
+// übernehmen, indem Sie "*" eingeben:
+[assembly: AssemblyVersion("0.1.0.0")]
+[assembly: AssemblyFileVersion("0.1.0.0")]
Added: trunk/plugins/My Connect4/Source/MyConnect4/State.cs
===================================================================
--- trunk/plugins/My Connect4/Source/MyConnect4/State.cs (rev 0)
+++ trunk/plugins/My Connect4/Source/MyConnect4/State.cs 2007-04-10 11:54:17 UTC (rev 303)
@@ -0,0 +1,313 @@
+using System;
+
+namespace MediaPortal.GUI.MyConnect
+{
+ /// <summary>
+ /// Monitors The State of a Game Board of width [columns] w, height [rows] h,
+ /// and maintains each possible winning combination of places on the
+ /// game board.
+ /// </summary>
+
+ public class State
+ {
+
+ private int winPlaces = 69, maxPieces = 42, Empty = 2;
+ private static bool[,,] map;
+ public int[,] board;
+ private int[,] score;
+ private int numPieces;
+ private int w = 7, h = 6, n = 4;
+
+ public int getW()
+ {
+ return w;
+ }
+ public int getH()
+ {
+ return h;
+ }
+ public int getN()
+ {
+ return n;
+ }
+
+ public State(int width, int height, int towin)
+ {
+ this.w = width;
+ this.h = height;
+ this.n = towin;
+
+ winPlaces = (h*(w-n+1))+(w*(h-n+1))+(2*((h-n+1)*(w-n+1)));
+ maxPieces = w*h;
+ this.board = new int[w,h];
+ this.score = new int[Empty,winPlaces];
+ int i, j, k, count = 0;
+
+ if (map == null)
+ {
+ map = new bool[w,h,winPlaces];
+ for (i = 0; i < w; i++)
+ for (j = 0; j < h; j++)
+ for (k = 0; k < winPlaces; k++)
+ map[i,j,k] = false;
+
+ // Set the horizontal win positions
+
+ for (i = 0; i < h; i++)
+ for (j = 0; j < (w - n) + 1; j++)
+ {
+ for (k = 0; k < n; k++)
+ map[j + k,i,count] = true;
+ count++;
+ }
+
+ // Set the vertical win positions
+
+ for (i = 0; i < w; i++)
+ for (j = 0; j < (h - n) + 1; j++)
+ {
+ for (k = 0; k < n; k++)
+ map[i,j + k,count] = true;
+ count++;
+ }
+
+ // Set the forward diagonal win positions
+
+ for (i = 0; i < (h - n) + 1; i++) //(i = 0; i < h - n; i++)
+ for (j = 0; j < (w - n) + 1; j++)
+ {
+ for (k = 0; k < n; k++)
+ map[j + k,i + k,count] = true;
+ count++;
+ }
+
+ // Set the backward diagonal win positions
+ ///
+ /// NOTE: the following nested loop is buggy...
+ /// one of the limit calculations is wrong...
+ /// result is that various combinations of
+ /// column x row sizes will cause either an exception
+ /// or will let a winning sequence be missed.
+ ///
+
+ for (i = 0; i < (h - n) + 1; i++)//(i = 0; i < h - n; i++)
+ for (j = w - 1; j >= w - n; j--)
+ { // ;j >= w - n + 1;
+ for (k = 0; k < n; k++)
+ map[j - k,i + k,count] = true;
+ count++;
+ }
+ }
+
+ // Initialize the board
+
+ for (i = 0; i < w; i++)
+ for (j = 0; j < h; j++)
+ board[i,j] = Empty;
+
+ // Initialize the scores
+
+ for (i = 0; i < 2; i++)
+ for (j = 0; j < winPlaces; j++)
+ score[i,j] = 1;
+
+ numPieces = 0;
+
+ }
+ public State(State state, int width, int height, int towin)
+ {
+ this.w = width;
+ this.h = height;
+ this.n = towin;
+
+ // work out the winning combinations on the given boardsize
+ // this is the number of times we can fit a unique line of
+ // length(n) in a board of height(h) by width(w)
+
+ winPlaces = (h*(w-n+1))+(w*(h-n+1))+(2*((h-n+1)*(w-n+1)));
+
+ // work out how many pieces will fill the board
+
+ maxPieces = w*h;
+
+ // create the board with the given height and width
+
+ this.board = new int[w,h];
+
+ // create an array to track player points for each move
+
+ this.score = new int[Empty,winPlaces];
+
+ // Copy the current board onto this one
+
+ for (int i = 0; i < w; i++)
+ for (int j = 0; j < h; j++)
+ board[i,j] = state.board[i,j];
+
+ // Copy the current scores onto this one
+
+ for (int i = 0; i < 2; i++)
+ for (int j = 0; j < winPlaces; j++)
+ score[i,j] = state.score[i,j];
+ numPieces = state.numPieces;
+ }
+
+ // winscore = 2^n IE. 4 balls in a row to win is 2^4 = 16
+
+ public bool isWinner(int player)
+ {
+ double winscore = Math.Pow(2, n);
+ for (int i = 0; i < winPlaces; i++)
+ if (score[player,i] == winscore)
+ return true;
+ return false;
+ }
+
+ public bool isTie()
+ {
+ return (numPieces == maxPieces);
+ }
+
+ public int dropPiece(int player, int xPos)
+ {
+ int yPos = 0;
+
+ // drop from the top to the first empty slot
+ // ******** access an animation simulation routine
+ // through here...
+
+ while ((board[xPos,yPos] != Empty) && (++yPos < h));
+ if (yPos == h) // if the column is full
+ return -1;
+
+ // otherwise the move is OK
+ // record the player now in that position
+
+ board[xPos,yPos] = player;
+ numPieces++;
+
+ // check the game state...
+
+ updateScore(player, xPos, yPos);
+ return yPos;
+ }
+
+ // evaluate continues Connect4Engine.computerMove method
+ // with alternate players
+
+ public int evaluate(int player, int level, int depth, int alpha, int beta)
+ {
+ int goodness, best, maxab = alpha;
+ if (level != depth)
+ {
+ best = -30000;
+
+ // drop into each column
+
+ for(int i = 0; i < w; i++)
+ {
+ State tempState = new State(this, w, h, n);
+
+ // if the column is full go to the next column...
+
+ if (tempState.dropPiece(getOtherPlayer(player), i) < 0)
+ continue;
+
+ // if the drop is a winner this is as far as we go in this
+ // look forward...
+
+ if (tempState.isWinner(getOtherPlayer(player)))
+ goodness = 25000 - depth;
+ else
+
+ // otherwise play the other players turn and see what they
+ // can do.
+
+ goodness = tempState.evaluate(getOtherPlayer(player),
+ level, depth + 1, -beta, -maxab);
+
+ // if their turn was better than ours, remember it.
+
+ if (goodness > best)
+ {
+ best = goodness;
+
+ // if this is the best so far remember it.
+
+ if (best > maxab)
+ maxab = best;
+ }
+
+ // logic error occurred - passed int limit
+ // simulates human error :)
+
+ if (best > beta)
+ break;
+ }
+ return -best;
+ }
+ return (calcScore(player) - calcScore(getOtherPlayer(player)));
+ }
+
+ // total a players score
+
+ private int calcScore(int player)
+ {
+ int s = 0;
+ for (int i = 0; i < winPlaces; i++)
+ s += score[player,i];
+ return s;
+ }
+
+ // update the score array. If a map array coordinate is true,
+ // find which player is in that square and add the player number
+ // to the scoreboard.
+
+ private void updateScore(int player, int x, int y)
+ {
+ for (int i = 0; i < winPlaces; i++)
+ if (map[x,y,i])
+ {
+ score[player,i] <<= 1;
+ score[getOtherPlayer(player),i] = 0;
+ }
+ }
+
+ // swap player focus
+
+ private int getOtherPlayer(int player)
+ {
+ return (1 - player);
+ }
+
+ // replaces game winner with temp value for animation routine
+
+ public int flashit(int lux)
+ {
+ double winner = Math.Pow(2, n);
+ int i, j, k = 0;
+ int winplayer = 1;
+ for(i = 0; i < 2; i++)
+ {
+ for(j = 0; j < winPlaces; j++)
+ {
+ if( score[i,j] == (int)winner )
+ k = j;
+ }
+ }
+ for(i = 0; i < w; i ++)
+ {
+ for(j = 0; j < h; j++)
+ {
+ if (map[i,j,k] == true)
+ {
+ winplayer = board[i,j];
+ board[i,j] = lux;
+ }
+ }
+ }
+ return winplayer;
+ }
+ }
+}
+
Added: trunk/plugins/My Connect4/Source/MyConnect4.sln
===================================================================
--- trunk/plugins/My Connect4/Source/MyConnect4.sln (rev 0)
+++ trunk/plugins/My Connect4/Source/MyConnect4.sln 2007-04-10 11:54:17 UTC (rev 303)
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyConnect4", "MyConnect4\MyConnect4.csproj", "{7D1DBAFA-199A-47D9-A19C-9FCBA4B3F1EA}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {7D1DBAFA-199A-47D9-A19C-9FCBA4B3F1EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7D1DBAFA-199A-47D9-A19C-9FCBA4B3F1EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7D1DBAFA-199A-47D9-A19C-9FCBA4B3F1EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7D1DBAFA-199A-47D9-A19C-9FCBA4B3F1EA}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
Added: trunk/plugins/My Connect4/Source/MyConnect4.suo
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Connect4/Source/MyConnect4.suo
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Connect4/Thumbs.db
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Connect4/Thumbs.db
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Connect4/readme.txt
===================================================================
--- trunk/plugins/My Connect4/readme.txt (rev 0)
+++ trunk/plugins/My Connect4/readme.txt 2007-04-10 11:54:17 UTC (rev 303)
@@ -0,0 +1,21 @@
+Visit the forum
+http://forum.team-mediaportal.com/new_game_connect_4_vier_gewinnt-t20442.html
+
+Connect 4 (Vier gewinnt)
+------------------------
+-Initial release
+-1 and 2 player support
+-Gameboard design by Mikael S\xF6derstr\xF6m.
+
+This nice game from MB as a MP version. You can play with
+- the mouse
+- remote left/right and OK
+
+Copy the plugin and skin files into your favorite skin folder.
+I had to adjust my remote a little in the setup. It was to sensitve.
+
+
+Have fun.
+
+Greetz
+kroko
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kro...@us...> - 2007-04-10 11:52:03
|
Revision: 302
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=302&view=rev
Author: kroko_koenig
Date: 2007-04-10 04:51:56 -0700 (Tue, 10 Apr 2007)
Log Message:
-----------
Inital release
Added Paths:
-----------
trunk/plugins/My Connect4/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kro...@us...> - 2007-04-10 11:50:06
|
Revision: 301
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=301&view=rev
Author: kroko_koenig
Date: 2007-04-10 04:49:50 -0700 (Tue, 10 Apr 2007)
Log Message:
-----------
Initial Release 0.1
Added Paths:
-----------
trunk/Connect4.jpg
trunk/Skin/
trunk/Skin/Media/
trunk/Skin/Media/MyConn4Cur.png
trunk/Skin/Media/MyConn4Gr.png
trunk/Skin/Media/MyConn4Rd.png
trunk/Skin/Media/MyConn4Wh.png
trunk/Skin/Media/MyConn4Ye.png
trunk/Skin/Media/MyConnBack.png
trunk/Skin/Media/hover_my connect4.png
trunk/Skin/MyConnect4.xml
trunk/Skin/Sounds/
trunk/Skin/Sounds/MyConnect4_klick.wav
trunk/Source/
trunk/Source/MyConnect4/
trunk/Source/MyConnect4/Engine.cs
trunk/Source/MyConnect4/MyConnect4.cs
trunk/Source/MyConnect4/MyConnect4.csproj
trunk/Source/MyConnect4/Properties/
trunk/Source/MyConnect4/Properties/AssemblyInfo.cs
trunk/Source/MyConnect4/State.cs
trunk/Source/MyConnect4.sln
trunk/Source/MyConnect4.suo
trunk/Thumbs.db
trunk/readme.txt
Added: trunk/Connect4.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/Connect4.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/Skin/Media/MyConn4Cur.png
===================================================================
(Binary files differ)
Property changes on: trunk/Skin/Media/MyConn4Cur.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/Skin/Media/MyConn4Gr.png
===================================================================
(Binary files differ)
Property changes on: trunk/Skin/Media/MyConn4Gr.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/Skin/Media/MyConn4Rd.png
===================================================================
(Binary files differ)
Property changes on: trunk/Skin/Media/MyConn4Rd.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/Skin/Media/MyConn4Wh.png
===================================================================
(Binary files differ)
Property changes on: trunk/Skin/Media/MyConn4Wh.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/Skin/Media/MyConn4Ye.png
===================================================================
(Binary files differ)
Property changes on: trunk/Skin/Media/MyConn4Ye.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/Skin/Media/MyConnBack.png
===================================================================
(Binary files differ)
Property changes on: trunk/Skin/Media/MyConnBack.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/Skin/Media/hover_my connect4.png
===================================================================
(Binary files differ)
Property changes on: trunk/Skin/Media/hover_my connect4.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/Skin/MyConnect4.xml
===================================================================
--- trunk/Skin/MyConnect4.xml (rev 0)
+++ trunk/Skin/MyConnect4.xml 2007-04-10 11:49:50 UTC (rev 301)
@@ -0,0 +1,604 @@
+<window>
+ <id>22031969</id>
+ <defaultcontrol>2</defaultcontrol>
+ <allowoverlay>yes</allowoverlay>
+ <autohidetopbar>yes</autohidetopbar>
+ <controls>
+ <import>common.time.xml</import>
+ <control>
+ <description>BackGround</description>
+ <type>image</type>
+ <id>10</id>
+ <posX>0</posX>
+ <posY>0</posY>
+ <width>720</width>
+ <height>576</height>
+ <texture>background.png</texture>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>11</id>
+ <posX>60</posX>
+ <posY>70</posY>
+ <label>Connect 4</label>
+ <font>font16</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <type>group</type>
+ <description>group element</description>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ <control>
+ <description>Start</description>
+ <type>button</type>
+ <id>2</id>
+ <posX>60</posX>
+ <posY>97</posY>
+ <label>Start</label>
+ <onleft>2</onleft>
+ <onright>301</onright>
+ <onup>7</onup>
+ <ondown>3</ondown>
+ </control>
+ <control>
+ <description>Mode</description>
+ <type>button</type>
+ <id>3</id>
+ <posX>60</posX>
+ <posY>131</posY>
+ <label>Mode: Play vs Player</label>
+ <onleft>3</onleft>
+ <onright>3</onright>
+ <onup>2</onup>
+ <ondown>4</ondown>
+ </control>
+ <control>
+ <description>Level</description>
+ <type>button</type>
+ <id>4</id>
+ <posX>60</posX>
+ <posY>165</posY>
+ <label>Level: Amateur</label>
+ <onleft>4</onleft>
+ <onright>4</onright>
+ <onup>3</onup>
+ <ondown>7</ondown>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>5</id>
+ <posX>70</posX>
+ <posY>205</posY>
+ <label>#Round</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>6</id>
+ <posX>70</posX>
+ <posY>240</posY>
+ <label>#Player</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ </control>
+ <control>
+ <description>Whatsthis</description>
+ <type>button</type>
+ <id>7</id>
+ <posX>60</posX>
+ <posY>270</posY>
+ <label>What's this?</label>
+ <onleft>7</onleft>
+ <onright>301</onright>
+ <onup>4</onup>
+ <ondown>2</ondown>
+ </control>
+ </control>
+ <control>
+ <description>BackGround Game</description>
+ <type>image</type>
+ <id>15</id>
+ <posX>260</posX>
+ <posY>120</posY>
+ <width>440</width>
+ <height>380</height>
+ <texture>MyConnBack.png</texture>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <type>group</type>
+ <description>group element</description>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ <control>
+ <type>image</type>
+ <id>101</id>
+ <posX>280</posX>
+ <posY>140</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_1_1</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>102</id>
+ <posX>340</posX>
+ <posY>140</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_1_2</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>103</id>
+ <posX>400</posX>
+ <posY>140</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_1_3</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>104</id>
+ <posX>460</posX>
+ <posY>140</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_1_4</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>105</id>
+ <posX>520</posX>
+ <posY>140</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_1_5</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>106</id>
+ <posX>580</posX>
+ <posY>140</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_1_6</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>107</id>
+ <posX>640</posX>
+ <posY>140</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_1_7</texture>
+ </control>
+
+ <control>
+ <type>image</type>
+ <id>111</id>
+ <posX>280</posX>
+ <posY>200</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_2_1</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>112</id>
+ <posX>340</posX>
+ <posY>200</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_2_2</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>113</id>
+ <posX>400</posX>
+ <posY>200</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_2_3</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>114</id>
+ <posX>460</posX>
+ <posY>200</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_2_4</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>115</id>
+ <posX>520</posX>
+ <posY>200</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_2_5</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>116</id>
+ <posX>580</posX>
+ <posY>200</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_2_6</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>117</id>
+ <posX>640</posX>
+ <posY>200</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_2_7</texture>
+ </control>
+
+ <control>
+ <type>image</type>
+ <id>121</id>
+ <posX>280</posX>
+ <posY>260</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_3_1</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>122</id>
+ <posX>340</posX>
+ <posY>260</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_3_2</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>123</id>
+ <posX>400</posX>
+ <posY>260</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_3_3</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>124</id>
+ <posX>460</posX>
+ <posY>260</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_3_4</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>125</id>
+ <posX>520</posX>
+ <posY>260</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_3_5</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>126</id>
+ <posX>580</posX>
+ <posY>260</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_3_6</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>127</id>
+ <posX>640</posX>
+ <posY>260</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_3_7</texture>
+ </control>
+
+ <control>
+ <type>image</type>
+ <id>131</id>
+ <posX>280</posX>
+ <posY>320</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_4_1</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>132</id>
+ <posX>340</posX>
+ <posY>320</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_4_2</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>133</id>
+ <posX>400</posX>
+ <posY>320</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_4_3</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>134</id>
+ <posX>460</posX>
+ <posY>320</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_4_4</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>135</id>
+ <posX>520</posX>
+ <posY>320</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_4_5</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>136</id>
+ <posX>580</posX>
+ <posY>320</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_4_6</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>137</id>
+ <posX>640</posX>
+ <posY>320</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_4_7</texture>
+ </control>
+
+ <control>
+ <type>image</type>
+ <id>141</id>
+ <posX>280</posX>
+ <posY>380</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_5_1</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>142</id>
+ <posX>340</posX>
+ <posY>380</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_5_2</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>143</id>
+ <posX>400</posX>
+ <posY>380</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_5_3</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>144</id>
+ <posX>460</posX>
+ <posY>380</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_5_4</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>145</id>
+ <posX>520</posX>
+ <posY>380</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_5_5</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>146</id>
+ <posX>580</posX>
+ <posY>380</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_5_6</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>147</id>
+ <posX>640</posX>
+ <posY>380</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_5_7</texture>
+ </control>
+
+ <control>
+ <type>image</type>
+ <id>151</id>
+ <posX>280</posX>
+ <posY>440</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_6_1</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>152</id>
+ <posX>340</posX>
+ <posY>440</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_6_2</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>153</id>
+ <posX>400</posX>
+ <posY>440</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_6_3</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>154</id>
+ <posX>460</posX>
+ <posY>440</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_6_4</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>155</id>
+ <posX>520</posX>
+ <posY>440</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_6_5</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>156</id>
+ <posX>580</posX>
+ <posY>440</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_6_6</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>157</id>
+ <posX>640</posX>
+ <posY>440</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_6_7</texture>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>18</id>
+ <posX>260</posX>
+ <posY>510</posY>
+ <label>#Status</label>
+ <font>font16</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ </control>
+ <control>
+ <description>Pointer 01</description>
+ <type>button</type>
+ <id>301</id>
+ <posX>280</posX>
+ <posY>70</posY>
+ <width>40</width>
+ <height>40</height>
+ <onleft>2</onleft>
+ <onright>302</onright>
+ <textureFocus>MyConn4Cur.png</textureFocus>
+ </control>
+ <control>
+ <description>Pointer 02</description>
+ <type>button</type>
+ <id>302</id>
+ <posX>340</posX>
+ <posY>70</posY>
+ <width>40</width>
+ <height>40</height>
+ <onleft>301</onleft>
+ <onright>303</onright>
+ <textureFocus>MyConn4Cur.png</textureFocus>
+ </control>
+ <control>
+ <description>Pointer 03</description>
+ <type>button</type>
+ <id>303</id>
+ <posX>400</posX>
+ <posY>70</posY>
+ <width>40</width>
+ <height>40</height>
+ <onleft>302</onleft>
+ <onright>304</onright>
+ <textureFocus>MyConn4Cur.png</textureFocus>
+ </control>
+ <control>
+ <description>Pointer 04</description>
+ <type>button</type>
+ <id>304</id>
+ <posX>460</posX>
+ <posY>70</posY>
+ <width>40</width>
+ <height>40</height>
+ <onleft>303</onleft>
+ <onright>305</onright>
+ <textureFocus>MyConn4Cur.png</textureFocus>
+ </control>
+ <control>
+ <description>Pointer 05</description>
+ <type>button</type>
+ <id>305</id>
+ <posX>520</posX>
+ <posY>70</posY>
+ <width>40</width>
+ <height>40</height>
+ <onleft>304</onleft>
+ <onright>306</onright>
+ <textureFocus>MyConn4Cur.png</textureFocus>
+ </control>
+ <control>
+ <description>Pointer 06</description>
+ <type>button</type>
+ <id>306</id>
+ <posX>580</posX>
+ <posY>70</posY>
+ <width>40</width>
+ <height>40</height>
+ <onleft>305</onleft>
+ <onright>307</onright>
+ <textureFocus>MyConn4Cur.png</textureFocus>
+ </control>
+ <control>
+ <description>Pointer 07</description>
+ <type>button</type>
+ <id>307</id>
+ <posX>640</posX>
+ <posY>70</posY>
+ <width>40</width>
+ <height>40</height>
+ <onleft>306</onleft>
+ <onright>307</onright>
+ <textureFocus>MyConn4Cur.png</textureFocus>
+ </control>
+ </control>
+ </controls>
+</window>
Added: trunk/Skin/Sounds/MyConnect4_klick.wav
===================================================================
(Binary files differ)
Property changes on: trunk/Skin/Sounds/MyConnect4_klick.wav
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/Source/MyConnect4/Engine.cs
===================================================================
--- trunk/Source/MyConnect4/Engine.cs (rev 0)
+++ trunk/Source/MyConnect4/Engine.cs 2007-04-10 11:49:50 UTC (rev 301)
@@ -0,0 +1,116 @@
+using System;
+using System.Drawing;
+
+namespace MediaPortal.GUI.MyConnect
+{
+ /// <summary>
+ /// Engine class handles the maintenance of player positions
+ /// on the game board and determines winning sequences of tokens.
+ /// </summary>
+ public class Engine
+ {
+ private static Random rand = new Random(System.DateTime.Now.Millisecond);
+ public State state;
+
+ public Engine(int w, int h, int n)
+ {
+ state = new State(w, h, n);
+ }
+
+ public State getState()
+ {
+ return state;
+ }
+ // drop a 'player' piece in column 'x'
+
+ public Point makeMove(int player, int xPos)
+ {
+ int yPos = state.dropPiece(player, xPos);
+ return (new Point(xPos, yPos));
+ }
+
+ // AI algorithm
+
+ public Point computerMove(int player, int level)
+ {
+ int bestXPos = -1, goodness = 0, bestWorst = -30000;
+ int numOfEqual = 0;
+
+ // Simulate a drop in each of the columns
+
+ for (int i = 0; i < state.getW(); i++)
+ {
+ State tempState = new State
+ (state, state.getW(), state.getH(), state.getN());
+
+ // If column is full, move on to the next column
+
+ if (tempState.dropPiece(player, i) < 0)
+ continue;
+
+ // If this drop wins the game, then cool
+
+ if (tempState.isWinner(player))
+ {
+ bestWorst = 25000;
+ bestXPos = i;
+ }
+
+ // If its not a winner, run evaluate algorithm 'level' times
+ // to find the best column to drop into. IE level 2 will
+ // look Columns x 2 drops into the future... etc etc.
+
+ else
+ goodness = tempState.evaluate(player, level, 1, -30000,
+ -bestWorst);
+
+ // If this move looks better than the previous move remember it
+
+ if (goodness > bestWorst)
+ {
+ bestWorst = goodness;
+ bestXPos = i;
+ numOfEqual = 1;
+ }
+
+ // If two moves are equally good, make a random choice
+
+ if (goodness == bestWorst)
+ {
+ numOfEqual++;
+ if (Math.Abs(rand.NextDouble()) % 10000 <
+ (10000 / numOfEqual))
+ bestXPos = i;
+ }
+ }
+
+ // Drop the piece in the best column
+
+ if (bestXPos >= 0)
+ {
+ int yPos = state.dropPiece(player, bestXPos);
+ if (yPos >= 0)
+ return (new Point(bestXPos, yPos));
+ }
+ return new Point(-1,-1);
+ }
+
+ // returns the state of the current gameboard
+
+ public int[,] getBoard()
+ {
+ return state.board;
+ }
+
+ public bool isWinner(int player)
+ {
+ return state.isWinner(player);
+ }
+
+ public bool isTie()
+ {
+ return state.isTie();
+ }
+ }
+}
+
Added: trunk/Source/MyConnect4/MyConnect4.cs
===================================================================
--- trunk/Source/MyConnect4/MyConnect4.cs (rev 0)
+++ trunk/Source/MyConnect4/MyConnect4.cs 2007-04-10 11:49:50 UTC (rev 301)
@@ -0,0 +1,480 @@
+#region Copyright (C) 2005-2007 Team MediaPortal
+
+/*
+ * Copyright (C) 2005-2007 Team MediaPortal
+ * http://www.team-mediaportal.com
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows.Forms;
+using System.Drawing;
+using MediaPortal.GUI.Library;
+using MediaPortal.Dialogs;
+using MediaPortal.Util;
+using MediaPortal.Utils;
+
+namespace MediaPortal.GUI.MyConnect
+{
+ public class MyConnect4GUI : GUIWindow , ISetupForm
+ {
+ #region SkinControl
+ [SkinControlAttribute(2)] protected GUIButtonControl BtnStart = null;
+ [SkinControlAttribute(4)] protected GUIButtonControl BtnLevel = null;
+ [SkinControlAttribute(3)] protected GUIButtonControl BtnMode = null;
+
+ [SkinControlAttribute(7)] protected GUIButtonControl BtnWhatsThis = null;
+ #endregion
+
+ #region Private variables
+
+ string Level="Am"; //Choosen level
+ int AI = 3;
+
+ string Mode = "2p"; //2player
+
+ int Player = 0;
+ int round = 0;
+
+ int wait = 0;
+
+ private static OnActionHandler ah;
+
+ private System.Windows.Forms.Timer _Game = new System.Windows.Forms.Timer();
+
+ private Engine gameEngine;
+
+ #endregion
+
+ #region ISetupForm Members
+
+ // Returns the name of the plugin which is shown in the plugin menu
+ public string PluginName()
+ {
+ return "My Connect 4";
+ }
+
+ // Returns the description of the plugin is shown in the plugin menu
+ public string Description()
+ {
+ return "Connect 4";
+ }
+
+ // Returns the author of the plugin which is shown in the plugin menu
+ public string Author()
+ {
+ return "Mark Koenig (kroko)";
+ }
+
+ // show the setup dialog
+ public void ShowPlugin()
+ {
+ MessageBox.Show("Nothing to configure, this is just an example");
+ }
+
+ // Indicates whether plugin can be enabled/disabled
+ public bool CanEnable()
+ {
+ return true;
+ }
+
+ // get ID of windowplugin belonging to this setup
+ public int GetWindowId()
+ {
+ return 22031969;
+ }
+
+ // Indicates if plugin is enabled by default;
+ public bool DefaultEnabled()
+ {
+ return true;
+ }
+
+ // indicates if a plugin has its own setup screen
+ public bool HasSetup()
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// If the plugin should have its own button on the main menu of MediaPortal then it
+ /// should return true to this method, otherwise if it should not be on home
+ /// it should return false
+ /// </summary>
+ /// <param name="strButtonText">text the button should have</param>
+ /// <param name="strButtonImage">image for the button, or empty for default</param>
+ /// <param name="strButtonImageFocus">image for the button, or empty for default</param>
+ /// <param name="strPictureImage">subpicture for the button or empty for none</param>
+ /// <returns>true : plugin needs its own button on home
+ /// false : plugin does not need its own button on home</returns>
+
+ public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage)
+ {
+ strButtonText = PluginName();
+ strButtonImage = String.Empty;
+ strButtonImageFocus = String.Empty;
+ strPictureImage = "hover_my connect4.png";
+ return true;
+ }
+
+ #endregion
+
+ public override int GetID
+ {
+ get
+ {
+ return 22031969;
+ }
+ set
+ {
+ base.GetID = value;
+ }
+ }
+
+ public override bool Init()
+ {
+ bool result = Load(GUIGraphicsContext.Skin + @"\MyConnect4.xml");
+ if (ah == null) ah = new OnActionHandler(OnAction2);
+ return result;
+ }
+
+ #region Actions
+ public override void OnAction(Action action)
+ {
+ base.OnAction(action);
+ }
+ public void OnAction2(Action action)
+ {
+
+ if (GUIWindowManager.ActiveWindowEx == (int)GUIWindow.Window.WINDOW_DIALOG_MENU) return;
+
+ //string t = action.wID.ToString();
+ //GUIPropertyManager.SetProperty("#Round", t);
+
+ if ((Player == 1) | (Player == 2 && Mode == "2p"))
+ {
+ switch (action.wID)
+ {
+ case Action.ActionType.ACTION_MOVE_LEFT:
+
+ break;
+ case Action.ActionType.ACTION_MOVE_RIGHT :
+
+ break;
+ case Action.ActionType.ACTION_SELECT_ITEM :
+
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ #endregion
+
+ public override bool OnMessage(GUIMessage message)
+ {
+ return base.OnMessage(message);
+ }
+
+ public void Dispose()
+ {
+ _Game.Stop();
+ _Game.Tick -= new EventHandler(_Game_Tick);
+ }
+
+ protected override void OnPageLoad()
+ {
+ _Game.Interval = 300;
+ _Game.Tick += new EventHandler(_Game_Tick);
+ _Game.Start();
+
+ Player = 0;
+ Level = "Am";
+ Mode = "2p";
+ AI = 3;
+
+ GUIPropertyManager.SetProperty("#Status", " ");
+ GUIControl.SetControlLabel(GetID, BtnLevel.GetID, "Level: Amateur");
+
+ // Disable level selection
+ GUIControl.DisableControl(GetID, 4);
+
+ RelButtons();
+
+ GUIGraphicsContext.OnNewAction -= ah;
+ GUIGraphicsContext.OnNewAction += ah;
+
+ base.OnPageLoad();
+
+ this.gameEngine = null;
+ this.gameEngine = new Engine(7, 6, 4);
+
+ Drawfield ();
+
+ }
+
+ protected override void OnPageDestroy(int new_windowId)
+ {
+ _Game.Stop();
+ _Game.Tick -= new EventHandler(_Game_Tick);
+ }
+
+ protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
+ {
+ if (control == BtnLevel)
+ OnBtnLevel();
+ if (control == BtnMode)
+ OnBtnMode();
+ if (control == BtnWhatsThis)
+ OnBtnWhatsThis();
+ if (control == BtnStart)
+ { //start game
+
+ if (Player == 0 && wait==0)
+ {
+ Player = 1;
+ round = 0;
+ GUIPropertyManager.SetProperty("#Status", " ");
+
+ // Disable start button
+ GUIControl.DisableControl(GetID, 2);
+ // Disable level selection
+ GUIControl.DisableControl(GetID, 3);
+ // Disable mode selection
+ GUIControl.DisableControl(GetID, 4);
+
+ this.gameEngine = null;
+ this.gameEngine = new Engine(7, 6, 4);
+
+ Drawfield();
+
+ wait = 2;
+ GUIControl.FocusControl(GetID, 15);
+ }
+ }
+ if ((Player==1)|(Player==2 && Mode=="2p"))
+ {
+
+ if ((controlId >= 301) && (controlId <= 307))
+ {
+ //which button has clicked ?
+ int col = controlId - 301;
+
+ PlayerClick(col);
+ wait = 2;
+ }
+ }
+ base.OnClicked(controlId, control, actionType);
+ }
+
+ protected override void OnShowContextMenu()
+ {
+ base.OnShowContextMenu();
+ }
+
+ private void OnBtnLevel()
+ { //Choose level for the game
+ if (Player==0)
+ {
+ if (Level == "Nor")
+ {
+ GUIControl.SetControlLabel(GetID, BtnLevel.GetID, "Level: Professional");
+ Level = "Pro";
+ AI = 7;
+ }
+ else if (Level == "Pro")
+ {
+ GUIControl.SetControlLabel(GetID, BtnLevel.GetID, "Level: Amateur");
+ Level = "Am";
+ AI = 3;
+ }
+ else
+ {
+ GUIControl.SetControlLabel(GetID, BtnLevel.GetID, "Level: Normal");
+ Level = "Nor";
+ AI = 5;
+ }
+ }
+ }
+
+ private void OnBtnMode()
+ { //Choose mode for the game
+ if (Player == 0)
+ {
+ if (Mode == "2p")
+ {
+ GUIControl.SetControlLabel(GetID, BtnMode.GetID, "Mode: Play vs Computer");
+ Mode = "1p";
+ // Enable level selection
+ GUIControl.EnableControl(GetID, 4);
+ }
+ else
+ {
+ GUIControl.SetControlLabel(GetID, BtnMode.GetID, "Mode: Play vs Player");
+ Mode = "2p";
+ // Disable level selection
+ GUIControl.DisableControl(GetID, 4);
+ }
+ }
+ }
+
+ private void OnBtnWhatsThis()
+ {
+ GUIDialogText dlg = (GUIDialogText)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_TEXT);
+ dlg.SetHeading("What's Connect 4 (Vier gewinnt)");
+ dlg.SetText("Connect 4 is a game where your object is to get 4 tokens in a row.\n" +
+ "This could be vertically, horizontal or diagonally.\n\n" +
+ "Gameboard design by Mikael S\xF6derstr\xF6m.\n\n" +
+ "AI code has been taken from http://www.Planet-Source-Code.com\n\n" +
+ "Good luck\nkroko");
+ dlg.DoModal(GetID);
+ }
+
+ private void Drawfield()
+ { // draw all fields
+
+ int[,] Myboard = gameEngine.getBoard();
+
+ for (int i = 0; i < 7; i++)
+ {
+ for (int j = 0; j < 6; j++)
+ {
+ string prop = "#Con_" + (6-j) + "_" + (i+1);
+
+ if (Myboard[i, j] == 2)
+ GUIPropertyManager.SetProperty(prop, "MyConn4Wh.png");
+ if (Myboard[i, j] == 0)
+ GUIPropertyManager.SetProperty(prop, "MyConn4Ye.png");
+ if (Myboard[i, j] == 1)
+ GUIPropertyManager.SetProperty(prop, "MyConn4Rd.png");
+ if (Myboard[i, j] > 2)
+ GUIPropertyManager.SetProperty(prop, "MyConn4Gr.png");
+ }
+ }
+ }
+
+ private void PlayerClick(int droppos)
+ {
+ Point pos = gameEngine.makeMove(Player - 1, droppos);
+ if (pos.Y >= 0)
+ {
+ round++;
+ Drawfield();
+ MediaPortal.Util.Utils.PlaySound("MyConnect4_klick.wav", false, true);
+
+
+ if (gameEngine.isWinner(Player - 1) == true)
+ {
+ int tmp = Player;
+ GUIPropertyManager.SetProperty("#Status", "Player " + tmp + " wins the game !");
+ Player = 0;
+ RelButtons();
+ gameEngine.getState().flashit(3);
+ Drawfield();
+ }
+ if (gameEngine.isTie() == true)
+ {
+ GUIPropertyManager.SetProperty("#Status", "Nobody wins the game ! Its a draw !");
+ Player = 0;
+ RelButtons();
+ GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK);
+ }
+ NextPlayer();
+ }
+
+ Drawfield();
+ }
+
+ private void NextPlayer()
+ {
+ if (Player != 0)
+ {
+ Player = Player + 1;
+ if (Player > 2)
+ Player = 1;
+ }
+ }
+
+ private void RelButtons()
+ {
+ // Enable start button
+ GUIControl.EnableControl(GetID, 2);
+ // Enable mode selection
+ GUIControl.EnableControl(GetID, 3);
+ if (Mode == "1p") // Enable level selection
+ GUIControl.EnableControl(GetID, 4);
+ // Enable What this
+ GUIControl.EnableControl(GetID, 7);
+
+ GUIControl.FocusControl(GetID, 2);
+ }
+
+ void _Game_Tick(object sender, EventArgs e)
+ {
+ //display status of the game
+ if (Player == 0)
+ GUIPropertyManager.SetProperty("#Player", "GAME OVER");
+ if (Player == 1)
+ GUIPropertyManager.SetProperty("#Player", "PLAYER 1");
+ if (Player == 2)
+ GUIPropertyManager.SetProperty("#Player", "PLAYER 2");
+ GUIPropertyManager.SetProperty("#Round", "Round: " + round );
+ //wait time
+ if (wait > 0)
+ {
+ wait = wait - 1;
+ }
+
+ if (Player == 2 && Mode == "1p" && wait==0)
+ {
+ Point pos = gameEngine.computerMove(1, AI);
+ if (pos.Y >= 0)
+ {
+ wait = 2;
+ round++;
+ Drawfield();
+ MediaPortal.Util.Utils.PlaySound("MyConnect4_klick.wav", false, true);
+
+
+ if (gameEngine.isWinner(Player - 1) == true)
+ {
+ GUIPropertyManager.SetProperty("#Status", "Player 2 wins the game !");
+ gameEngine.getState().flashit(3);
+ Drawfield();
+ Player = 0;
+ RelButtons();
+ }
+ if (gameEngine.isTie() == true)
+ {
+ GUIPropertyManager.SetProperty("#Status", "Nobody wins the game ! Its a draw !");
+ Player = 0;
+ RelButtons();
+ }
+ NextPlayer();
+ }
+ Drawfield();
+
+ }
+ }
+
+ }
+}
Added: trunk/Source/MyConnect4/MyConnect4.csproj
===================================================================
--- trunk/Source/MyConnect4/MyConnect4.csproj (rev 0)
+++ trunk/Source/MyConnect4/MyConnect4.csproj 2007-04-10 11:49:50 UTC (rev 301)
@@ -0,0 +1,54 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{7D1DBAFA-199A-47D9-A19C-9FCBA4B3F1EA}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>MyConnect4</RootNamespace>
+ <AssemblyName>MyConnect4</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Core, Version=1.0.2593.1921, Culture=neutral, processorArchitecture=MSIL" />
+ <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ <Reference Include="Utils, Version=1.0.2593.1896, Culture=neutral, processorArchitecture=MSIL" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Engine.cs" />
+ <Compile Include="MyConnect4.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="State.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
Added: trunk/Source/MyConnect4/Properties/AssemblyInfo.cs
===================================================================
--- trunk/Source/MyConnect4/Properties/AssemblyInfo.cs (rev 0)
+++ trunk/Source/MyConnect4/Properties/AssemblyInfo.cs 2007-04-10 11:49:50 UTC (rev 301)
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// Allgemeine Informationen über eine Assembly werden über die folgenden
+// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
+// die mit einer Assembly verknüpft sind.
+[assembly: AssemblyTitle("MyConnect4")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("MyConnect4")]
+[assembly: AssemblyCopyright("Copyright © 2007")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
+// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
+// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
+[assembly: ComVisible(false)]
+
+// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
+[assembly: Guid("9c36c885-c7f8-460a-a4bf-4b1893faf9bf")]
+
+// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
+//
+// Hauptversion
+// Nebenversion
+// Buildnummer
+// Revision
+//
+// Sie können alle Werte angeben oder die standardmäßigen Revisions- und Buildnummern
+// übernehmen, indem Sie "*" eingeben:
+[assembly: AssemblyVersion("0.1.0.0")]
+[assembly: AssemblyFileVersion("0.1.0.0")]
Added: trunk/Source/MyConnect4/State.cs
===================================================================
--- trunk/Source/MyConnect4/State.cs (rev 0)
+++ trunk/Source/MyConnect4/State.cs 2007-04-10 11:49:50 UTC (rev 301)
@@ -0,0 +1,313 @@
+using System;
+
+namespace MediaPortal.GUI.MyConnect
+{
+ /// <summary>
+ /// Monitors The State of a Game Board of width [columns] w, height [rows] h,
+ /// and maintains each possible winning combination of places on the
+ /// game board.
+ /// </summary>
+
+ public class State
+ {
+
+ private int winPlaces = 69, maxPieces = 42, Empty = 2;
+ private static bool[,,] map;
+ public int[,] board;
+ private int[,] score;
+ private int numPieces;
+ private int w = 7, h = 6, n = 4;
+
+ public int getW()
+ {
+ return w;
+ }
+ public int getH()
+ {
+ return h;
+ }
+ public int getN()
+ {
+ return n;
+ }
+
+ public State(int width, int height, int towin)
+ {
+ this.w = width;
+ this.h = height;
+ this.n = towin;
+
+ winPlaces = (h*(w-n+1))+(w*(h-n+1))+(2*((h-n+1)*(w-n+1)));
+ maxPieces = w*h;
+ this.board = new int[w,h];
+ this.score = new int[Empty,winPlaces];
+ int i, j, k, count = 0;
+
+ if (map == null)
+ {
+ map = new bool[w,h,winPlaces];
+ for (i = 0; i < w; i++)
+ for (j = 0; j < h; j++)
+ for (k = 0; k < winPlaces; k++)
+ map[i,j,k] = false;
+
+ // Set the horizontal win positions
+
+ for (i = 0; i < h; i++)
+ for (j = 0; j < (w - n) + 1; j++)
+ {
+ for (k = 0; k < n; k++)
+ map[j + k,i,count] = true;
+ count++;
+ }
+
+ // Set the vertical win positions
+
+ for (i = 0; i < w; i++)
+ for (j = 0; j < (h - n) + 1; j++)
+ {
+ for (k = 0; k < n; k++)
+ map[i,j + k,count] = true;
+ count++;
+ }
+
+ // Set the forward diagonal win positions
+
+ for (i = 0; i < (h - n) + 1; i++) //(i = 0; i < h - n; i++)
+ for (j = 0; j < (w - n) + 1; j++)
+ {
+ for (k = 0; k < n; k++)
+ map[j + k,i + k,count] = true;
+ count++;
+ }
+
+ // Set the backward diagonal win positions
+ ///
+ /// NOTE: the following nested loop is buggy...
+ /// one of the limit calculations is wrong...
+ /// result is that various combinations of
+ /// column x row sizes will cause either an exception
+ /// or will let a winning sequence be missed.
+ ///
+
+ for (i = 0; i < (h - n) + 1; i++)//(i = 0; i < h - n; i++)
+ for (j = w - 1; j >= w - n; j--)
+ { // ;j >= w - n + 1;
+ for (k = 0; k < n; k++)
+ map[j - k,i + k,count] = true;
+ count++;
+ }
+ }
+
+ // Initialize the board
+
+ for (i = 0; i < w; i++)
+ for (j = 0; j < h; j++)
+ board[i,j] = Empty;
+
+ // Initialize the scores
+
+ for (i = 0; i < 2; i++)
+ for (j = 0; j < winPlaces; j++)
+ score[i,j] = 1;
+
+ numPieces = 0;
+
+ }
+ public State(State state, int width, int height, int towin)
+ {
+ this.w = width;
+ this.h = height;
+ this.n = towin;
+
+ // work out the winning combinations on the given boardsize
+ // this is the number of times we can fit a unique line of
+ // length(n) in a board of height(h) by width(w)
+
+ winPlaces = (h*(w-n+1))+(w*(h-n+1))+(2*((h-n+1)*(w-n+1)));
+
+ // work out how many pieces will fill the board
+
+ maxPieces = w*h;
+
+ // create the board with the given height and width
+
+ this.board = new int[w,h];
+
+ // create an array to track player points for each move
+
+ this.score = new int[Empty,winPlaces];
+
+ // Copy the current board onto this one
+
+ for (int i = 0; i < w; i++)
+ for (int j = 0; j < h; j++)
+ board[i,j] = state.board[i,j];
+
+ // Copy the current scores onto this one
+
+ for (int i = 0; i < 2; i++)
+ for (int j = 0; j < winPlaces; j++)
+ score[i,j] = state.score[i,j];
+ numPieces = state.numPieces;
+ }
+
+ // winscore = 2^n IE. 4 balls in a row to win is 2^4 = 16
+
+ public bool isWinner(int player)
+ {
+ double winscore = Math.Pow(2, n);
+ for (int i = 0; i < winPlaces; i++)
+ if (score[player,i] == winscore)
+ return true;
+ return false;
+ }
+
+ public bool isTie()
+ {
+ return (numPieces == maxPieces);
+ }
+
+ public int dropPiece(int player, int xPos)
+ {
+ int yPos = 0;
+
+ // drop from the top to the first empty slot
+ // ******** access an animation simulation routine
+ // through here...
+
+ while ((board[xPos,yPos] != Empty) && (++yPos < h));
+ if (yPos == h) // if the column is full
+ return -1;
+
+ // otherwise the move is OK
+ // record the player now in that position
+
+ board[xPos,yPos] = player;
+ numPieces++;
+
+ // check the game state...
+
+ updateScore(player, xPos, yPos);
+ return yPos;
+ }
+
+ // evaluate continues Connect4Engine.computerMove method
+ // with alternate players
+
+ public int evaluate(int player, int level, int depth, int alpha, int beta)
+ {
+ int goodness, best, maxab = alpha;
+ if (level != depth)
+ {
+ best = -30000;
+
+ // drop into each column
+
+ for(int i = 0; i < w; i++)
+ {
+ State tempState = new State(this, w, h, n);
+
+ // if the column is full go to the next column...
+
+ if (tempState.dropPiece(getOtherPlayer(player), i) < 0)
+ continue;
+
+ // if the drop is a winner this is as far as we go in this
+ // look forward...
+
+ if (tempState.isWinner(getOtherPlayer(player)))
+ goodness = 25000 - depth;
+ else
+
+ // otherwise play the other players turn and see what they
+ // can do.
+
+ goodness = tempState.evaluate(getOtherPlayer(player),
+ level, depth + 1, -beta, -maxab);
+
+ // if their turn was better than ours, remember it.
+
+ if (goodness > best)
+ {
+ best = goodness;
+
+ // if this is the best so far remember it.
+
+ if (best > maxab)
+ maxab = best;
+ }
+
+ // logic error occurred - passed int limit
+ // simulates human error :)
+
+ if (best > beta)
+ break;
+ }
+ return -best;
+ }
+ return (calcScore(player) - calcScore(getOtherPlayer(player)));
+ }
+
+ // total a players score
+
+ private int calcScore(int player)
+ {
+ int s = 0;
+ for (int i = 0; i < winPlaces; i++)
+ s += score[player,i];
+ return s;
+ }
+
+ // update the score array. If a map array coordinate is true,
+ // find which player is in that square and add the player number
+ // to the scoreboard.
+
+ private void updateScore(int player, int x, int y)
+ {
+ for (int i = 0; i < winPlaces; i++)
+ if (map[x,y,i])
+ {
+ score[player,i] <<= 1;
+ score[getOtherPlayer(player),i] = 0;
+ }
+ }
+
+ // swap player focus
+
+ private int getOtherPlayer(int player)
+ {
+ return (1 - player);
+ }
+
+ // replaces game winner with temp value for animation routine
+
+ public int flashit(int lux)
+ {
+ double winner = Math.Pow(2, n);
+ int i, j, k = 0;
+ int winplayer = 1;
+ for(i = 0; i < 2; i++)
+ {
+ for(j = 0; j < winPlaces; j++)
+ {
+ if( score[i,j] == (int)winner )
+ k = j;
+ }
+ }
+ for(i = 0; i < w; i ++)
+ {
+ for(j = 0; j < h; j++)
+ {
+ if (map[i,j,k] == true)
+ {
+ winplayer = board[i,j];
+ board[i,j] = lux;
+ }
+ }
+ }
+ return winplayer;
+ }
+ }
+}
+
Added: trunk/Source/MyConnect4.sln
===================================================================
--- trunk/Source/MyConnect4.sln (rev 0)
+++ trunk/Source/MyConnect4.sln 2007-04-10 11:49:50 UTC (rev 301)
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyConnect4", "MyConnect4\MyConnect4.csproj", "{7D1DBAFA-199A-47D9-A19C-9FCBA4B3F1EA}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {7D1DBAFA-199A-47D9-A19C-9FCBA4B3F1EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7D1DBAFA-199A-47D9-A19C-9FCBA4B3F1EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7D1DBAFA-199A-47D9-A19C-9FCBA4B3F1EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7D1DBAFA-199A-47D9-A19C-9FCBA4B3F1EA}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
Added: trunk/Source/MyConnect4.suo
===================================================================
(Binary files differ)
Property changes on: trunk/Source/MyConnect4.suo
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/Thumbs.db
===================================================================
(Binary files differ)
Property changes on: trunk/Thumbs.db
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/readme.txt
===================================================================
--- trunk/readme.txt (rev 0)
+++ trunk/readme.txt 2007-04-10 11:49:50 UTC (rev 301)
@@ -0,0 +1,21 @@
+Visit the forum
+http://forum.team-mediaportal.com/new_game_connect_4_vier_gewinnt-t20442.html
+
+Connect 4 (Vier gewinnt)
+------------------------
+-Initial release
+-1 and 2 player support
+-Gameboard design by Mikael S\xF6derstr\xF6m.
+
+This nice game from MB as a MP version. You can play with
+- the mouse
+- remote left/right and OK
+
+Copy the plugin and skin files into your favorite skin folder.
+I had to adjust my remote a little in the setup. It was to sensitve.
+
+
+Have fun.
+
+Greetz
+kroko
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kro...@us...> - 2007-04-10 11:48:35
|
Revision: 300
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=300&view=rev
Author: kroko_koenig
Date: 2007-04-10 04:42:31 -0700 (Tue, 10 Apr 2007)
Log Message:
-----------
Add a small waiting time after clearing the playlist to give the dll enought time. (Multitask)
Modified Paths:
--------------
trunk/plugins/VideoLAN/VideoLanPlugin.cs
Modified: trunk/plugins/VideoLAN/VideoLanPlugin.cs
===================================================================
--- trunk/plugins/VideoLAN/VideoLanPlugin.cs 2007-04-09 16:35:53 UTC (rev 299)
+++ trunk/plugins/VideoLAN/VideoLanPlugin.cs 2007-04-10 11:42:31 UTC (rev 300)
@@ -161,6 +161,10 @@
vlcControl.Stop();
vlcControl.ClearPlayList();
+
+ System.Threading.Thread.Sleep(1000);
+ //wait for vlc strange playlist problem
+
vlcControl.AddToPlayList(strFile, null, option);
vlcControl.Play();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <du...@us...> - 2007-04-09 16:36:27
|
Revision: 299
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=299&view=rev
Author: dukus
Date: 2007-04-09 09:35:53 -0700 (Mon, 09 Apr 2007)
Log Message:
-----------
Working action interpreter
Modified Paths:
--------------
trunk/plugins/mpinstaler/MPInstaler/MPIutils.cs
trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs
trunk/plugins/mpinstaler/MPInstaler/wizard/controlp.cs
trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.cs
Modified: trunk/plugins/mpinstaler/MPInstaler/MPIutils.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/MPIutils.cs 2007-04-09 03:03:35 UTC (rev 298)
+++ trunk/plugins/mpinstaler/MPInstaler/MPIutils.cs 2007-04-09 16:35:53 UTC (rev 299)
@@ -1,7 +1,14 @@
using System;
+using System.IO;
using System.Diagnostics;
using System.Collections.Generic;
using System.Text;
+using System.Drawing;
+using System.ComponentModel;
+using MediaPortal.GUI.Library;
+using MediaPortal.Configuration;
+using System.Reflection;
+using System.Windows.Forms;
namespace MPInstaler
{
@@ -10,7 +17,65 @@
public MPIutils()
{
}
-
+
+ static public void LoadPlugins(string pluginFile)
+ {
+ if (!File.Exists(pluginFile))
+ {
+ MessageBox.Show("File not found "+pluginFile);
+ return;
+ }
+ try
+ {
+ Assembly pluginAssembly = Assembly.LoadFrom(pluginFile);
+
+ if (pluginAssembly != null)
+ {
+ Type[] exportedTypes = pluginAssembly.GetExportedTypes();
+
+ foreach (Type type in exportedTypes)
+ {
+ if (type.IsAbstract)
+ {
+ continue;
+ }
+ if (type.GetInterface("MediaPortal.GUI.Library.ISetupForm") != null)
+ {
+ try
+ {
+ //
+ // Create instance of the current type
+ //
+ object pluginObject = Activator.CreateInstance(type);
+ ISetupForm pluginForm = pluginObject as ISetupForm;
+
+ if (pluginForm != null)
+ {
+ if (pluginForm.HasSetup())
+ pluginForm.ShowPlugin();
+ //ItemTag tag = new ItemTag();
+ //tag.SetupForm = pluginForm;
+ //tag.DLLName = pluginFile.Substring(pluginFile.LastIndexOf(@"\") + 1);
+ //tag.windowId = pluginForm.GetWindowId();
+ //loadedPlugins.Add(tag);
+ }
+ }
+ catch (Exception setupFormException)
+ {
+ MessageBox.Show(string.Format("Exception in plugin SetupForm loading : {0} ", setupFormException.Message));
+
+ }
+ }
+ }
+ }
+ }
+ catch (Exception unknownException)
+ {
+ MessageBox.Show("Exception in plugin loading :{0}", unknownException.Message);
+ }
+ }
+
+
static public void StartApp(string file)
{
Process app = new Process();
Modified: trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs 2007-04-09 03:03:35 UTC (rev 298)
+++ trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs 2007-04-09 16:35:53 UTC (rev 299)
@@ -396,6 +396,20 @@
return fs;
}
+ public MPIFileList FindFile(string file)
+ {
+ MPIFileList fs = new MPIFileList();
+ for (int i = 0; i < FileList.Count; i++)
+ {
+ if ((((MPIFileList)FileList[i]).FileNameShort == file))
+ {
+ fs = (MPIFileList)FileList[i];
+ break;
+ }
+ }
+ return fs;
+ }
+
public string GetZipEntry(MPIFileList flst)
{
string ret = string.Empty;
@@ -707,7 +721,7 @@
else return false;
}
- public void ExecuteAction()
+ public void ExecuteAction(MPinstalerStruct xmp)
{
switch (Place)
{
@@ -715,9 +729,12 @@
switch (Id)
{
case 0:
+
MPIutils.StartApp(Config.GetFile(Config.Dir.Base,Command));
break;
case 1:
+ MPIFileList fs = xmp.FindFile(Command);
+ MPIutils.LoadPlugins(MPinstalerStruct.GetDirEntry(fs));
break;
}
break;
Modified: trunk/plugins/mpinstaler/MPInstaler/wizard/controlp.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/wizard/controlp.cs 2007-04-09 03:03:35 UTC (rev 298)
+++ trunk/plugins/mpinstaler/MPInstaler/wizard/controlp.cs 2007-04-09 16:35:53 UTC (rev 299)
@@ -24,7 +24,7 @@
public controlp()
{
InitializeComponent();
- //pictureBox1.Load("http://webmaster.extra.hu/banner/extra134x77.gif");
+
}
private void button2_Click(object sender, EventArgs e)
@@ -69,18 +69,18 @@
SetGroups(0, lv);
}
- private void InitGroups( ListView myListView)
+ private void InitGroups(ListView myListView)
{
groupTables = new Hashtable[myListView.Columns.Count];
for (int column = 0; column < myListView.Columns.Count; column++)
{
// Create a hash table containing all the groups
// needed for a single column.
- groupTables[column] = CreateGroupsTable(column,myListView);
+ groupTables[column] = CreateGroupsTable(column, myListView);
}
// Start with the groups created for the Title column.
- SetGroups(0,myListView);
+ SetGroups(0, myListView);
}
private void SetGroups(int column, ListView myListView)
@@ -190,7 +190,7 @@
{
button1.Enabled = false;
button3.Enabled = false;
- button4.Enabled = false;
+ button4.Enabled = false;
}
}
@@ -210,7 +210,7 @@
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
string temp_file = Path.GetFullPath(Environment.GetEnvironmentVariable("TEMP")) + @"\" + "MPExtensionFileList.xml";
- if (MPInstallHelper.Download(comboBox1.Text + "/" + "MPExtensionFileList.xml",temp_file))
+ if (MPInstallHelper.Download(comboBox1.Text + "/" + "MPExtensionFileList.xml", temp_file))
{
if (File.Exists(temp_file))
{
@@ -232,7 +232,7 @@
{
string file_name = listView2.SelectedItems[0].SubItems[3].Text;
string temp_file = Path.GetFullPath(Environment.GetEnvironmentVariable("TEMP")) + @"\" + file_name;
- download_form dw = new download_form(comboBox1.Text+"/"+file_name,temp_file);
+ download_form dw = new download_form(comboBox1.Text + "/" + file_name, temp_file);
dw.Text = listView2.SelectedItems[0].SubItems[3].Text;
dw.ShowDialog();
if (File.Exists(temp_file))
@@ -284,7 +284,7 @@
groupColumn = e.Column;
// Set the groups to those created for the clicked column.
- SetGroups(e.Column,listView1);
+ SetGroups(e.Column, listView1);
}
@@ -358,7 +358,7 @@
file_name = pk1.FileName;
temp_file = Path.GetFullPath(Environment.GetEnvironmentVariable("TEMP")) + @"\" + file_name;
download_form dw1 = new download_form(pk1._intalerStruct.UpdateURL + "/" + file_name, temp_file);
- dw1.Text = pk1._intalerStruct.UpdateURL+"/"+pk1.FileName+"/"+pk1._intalerStruct.Version;
+ dw1.Text = pk1._intalerStruct.UpdateURL + "/" + pk1.FileName + "/" + pk1._intalerStruct.Version;
dw1.ShowDialog();
if (File.Exists(temp_file))
{
@@ -398,57 +398,7 @@
}
}
}
-
- private void LoadPlugins(string pluginFile)
- {
- try
- {
- Assembly pluginAssembly = Assembly.LoadFrom(pluginFile);
- if (pluginAssembly != null)
- {
- Type[] exportedTypes = pluginAssembly.GetExportedTypes();
-
- foreach (Type type in exportedTypes)
- {
- if (type.IsAbstract)
- {
- continue;
- }
- if (type.GetInterface("MediaPortal.GUI.Library.ISetupForm") != null)
- {
- try
- {
- //
- // Create instance of the current type
- //
- object pluginObject = Activator.CreateInstance(type);
- ISetupForm pluginForm = pluginObject as ISetupForm;
-
- if (pluginForm != null)
- {
- //ItemTag tag = new ItemTag();
- //tag.SetupForm = pluginForm;
- //tag.DLLName = pluginFile.Substring(pluginFile.LastIndexOf(@"\") + 1);
- //tag.windowId = pluginForm.GetWindowId();
- //loadedPlugins.Add(tag);
- }
- }
- catch (Exception setupFormException)
- {
- MessageBox.Show("Exception in plugin SetupForm loading :{0}", setupFormException.Message);
-
- }
- }
- }
- }
- }
- catch (Exception unknownException)
- {
- MessageBox.Show("Exception in plugin loading :{0}", unknownException.Message);
- }
- }
-
}
public class ListViewGroupSorter : IComparer
Modified: trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.cs 2007-04-09 03:03:35 UTC (rev 298)
+++ trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.cs 2007-04-09 16:35:53 UTC (rev 299)
@@ -252,8 +252,10 @@
{
int i=skinlister.Items.IndexOf(ac.ToString());
if (skinlister.GetSelected(i))
- ac.ExecuteAction();
+ ac.ExecuteAction(package._intalerStruct);
}
+
+ this.Close();
}
else
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <che...@us...> - 2007-04-09 03:04:27
|
Revision: 298
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=298&view=rev
Author: chef_koch
Date: 2007-04-08 20:03:35 -0700 (Sun, 08 Apr 2007)
Log Message:
-----------
fixed importing first line of FritzBoxMonitors export-file
added message box with import result
Modified Paths:
--------------
trunk/plugins/FritzBox/FritzBox.cs
trunk/plugins/FritzBox/FritzBoxSetupFrom.cs
Modified: trunk/plugins/FritzBox/FritzBox.cs
===================================================================
--- trunk/plugins/FritzBox/FritzBox.cs 2007-04-08 17:34:44 UTC (rev 297)
+++ trunk/plugins/FritzBox/FritzBox.cs 2007-04-09 03:03:35 UTC (rev 298)
@@ -242,10 +242,12 @@
}
}
- public static void ImportFritzBoxMonitor(string filepath)
+ public static int ImportFritzBoxMonitor(string filepath)
{
try
{
+ int count = 0;
+
// Create an instance of StreamReader to read from a file.
// The using statement also closes the StreamReader.
using (StreamReader sr = new StreamReader(filepath))
@@ -260,18 +262,25 @@
Caller caller = new Caller();
caller.ID = ar[2];
- caller.Name = String.Format("{0} {1}", ar[0], ar[1]);
+ caller.Name = string.Format("{0} {1}", ar[0], ar[1]);
+ caller.Name = caller.Name.Trim();
caller.Show = true;
- if (!CallerExists(caller))
- phonebook.Add(caller);
+ if (CallerExists(caller)) continue;
+ if (caller.ID == "Telefonnummer") continue;
+
+ phonebook.Add(caller);
+ count++;
}
}
+
+ return count;
}
catch (Exception e)
{
// Let the user know what went wrong.
Log.Error("The file could not be read: {0}", e.Message);
+ return 0;
}
}
Modified: trunk/plugins/FritzBox/FritzBoxSetupFrom.cs
===================================================================
--- trunk/plugins/FritzBox/FritzBoxSetupFrom.cs 2007-04-08 17:34:44 UTC (rev 297)
+++ trunk/plugins/FritzBox/FritzBoxSetupFrom.cs 2007-04-09 03:03:35 UTC (rev 298)
@@ -144,6 +144,7 @@
this.labelHelp = new MediaPortal.UserInterface.Controls.MPLabel();
this.tabIncoming = new System.Windows.Forms.TabPage();
this.groupBoxPhonebook = new MediaPortal.UserInterface.Controls.MPGroupBox();
+ this.mpImportFBMonitor = new MediaPortal.UserInterface.Controls.MPButton();
this.checkBoxSaveUnknownCaller = new MediaPortal.UserInterface.Controls.MPCheckBox();
this.checkBoxShowUnknownCaller = new MediaPortal.UserInterface.Controls.MPCheckBox();
this.checkBoxUsePhonebook = new MediaPortal.UserInterface.Controls.MPCheckBox();
@@ -174,7 +175,6 @@
this.buttonCancel = new MediaPortal.UserInterface.Controls.MPButton();
this.buttonSave = new MediaPortal.UserInterface.Controls.MPButton();
this.labelVersion = new MediaPortal.UserInterface.Controls.MPLabel();
- this.mpImportFBMonitor = new MediaPortal.UserInterface.Controls.MPButton();
this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
this.tabControlFritzBoxSettings.SuspendLayout();
this.tabGeneral.SuspendLayout();
@@ -344,6 +344,17 @@
this.groupBoxPhonebook.TabStop = false;
this.groupBoxPhonebook.Text = "phonebook settings";
//
+ // mpImportFBMonitor
+ //
+ this.mpImportFBMonitor.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.mpImportFBMonitor.Location = new System.Drawing.Point(355, 20);
+ this.mpImportFBMonitor.Name = "mpImportFBMonitor";
+ this.mpImportFBMonitor.Size = new System.Drawing.Size(150, 23);
+ this.mpImportFBMonitor.TabIndex = 3;
+ this.mpImportFBMonitor.Text = "Import FRITZ!Box Monitor";
+ this.mpImportFBMonitor.UseVisualStyleBackColor = true;
+ this.mpImportFBMonitor.Click += new System.EventHandler(this.mpImportFBMonitor_Click);
+ //
// checkBoxSaveUnknownCaller
//
this.checkBoxSaveUnknownCaller.AutoSize = true;
@@ -626,6 +637,7 @@
this.dataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dataGridView.Size = new System.Drawing.Size(405, 297);
this.dataGridView.TabIndex = 5;
+ this.dataGridView.Sorted += new System.EventHandler(this.dataGridView_Sorted);
this.dataGridView.SelectionChanged += new System.EventHandler(this.dataGridView_SelectionChanged);
//
// colCallerId
@@ -700,17 +712,6 @@
this.labelVersion.TabIndex = 13;
this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
- // mpImportFBMonitor
- //
- this.mpImportFBMonitor.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.mpImportFBMonitor.Location = new System.Drawing.Point(355, 20);
- this.mpImportFBMonitor.Name = "mpImportFBMonitor";
- this.mpImportFBMonitor.Size = new System.Drawing.Size(150, 23);
- this.mpImportFBMonitor.TabIndex = 3;
- this.mpImportFBMonitor.Text = "Import FRITZ!Box Monitor";
- this.mpImportFBMonitor.UseVisualStyleBackColor = true;
- this.mpImportFBMonitor.Click += new System.EventHandler(this.mpImportFBMonitor_Click);
- //
// FritzBoxSetupForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 14);
@@ -947,33 +948,39 @@
private void buttonCallerChange_Click(object sender, EventArgs e)
{
- if (CheckCallerId() && CheckCallerName())
- if (dataGridView.Rows[dataGridView.NewRowIndex].Selected)
- {
- dataGridView.Rows.Add(textBoxCallerId.Text, textBoxCallerName.Text, checkBoxCallerShow.Checked);
+ if (!CheckCallerId()) return;
+ if (!CheckCallerName()) return;
- textBoxCallerId.Text = "";
- textBoxCallerName.Text = "";
- checkBoxCallerShow.Checked = false;
+ if (dataGridView.Rows[dataGridView.NewRowIndex].Selected)
+ {
+ dataGridView.Rows.Add(textBoxCallerId.Text, textBoxCallerName.Text, checkBoxCallerShow.Checked);
- textBoxCallerId.Focus();
- }
- else
- {
- string oldfile = MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac,
- dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[1].Value.ToString());
+ textBoxCallerId.Text = "";
+ textBoxCallerName.Text = "";
+ checkBoxCallerShow.Checked = false;
- string newfile = String.Format(@"{0}\{1}{2}", Thumbs.Yac, Utils.MakeFileName(textBoxCallerName.Text), Utils.GetThumbExtension());
+ textBoxCallerId.Focus();
- if (File.Exists(oldfile))
- File.Move(oldfile, newfile);
+ SaveDataGridView();
+ }
+ else
+ {
+ string oldfile = MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac,
+ dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[1].Value.ToString());
- dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[0].Value = textBoxCallerId.Text;
- dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[1].Value = textBoxCallerName.Text;
- dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[2].Value = checkBoxCallerShow.Checked;
+ string newfile = String.Format(@"{0}\{1}{2}", Thumbs.Yac, Utils.MakeFileName(textBoxCallerName.Text), Utils.GetThumbExtension());
- pictureBoxCaller.ImageLocation = MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, textBoxCallerName.Text);
- }
+ if (File.Exists(oldfile))
+ File.Move(oldfile, newfile);
+
+ dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[0].Value = textBoxCallerId.Text;
+ dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[1].Value = textBoxCallerName.Text;
+ dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[2].Value = checkBoxCallerShow.Checked;
+
+ pictureBoxCaller.ImageLocation = MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, textBoxCallerName.Text);
+
+ SaveDataGridView();
+ }
}
private bool CheckCallerId()
@@ -1014,6 +1021,8 @@
if ((!dataGridView.Rows[dataGridView.NewRowIndex].Selected) && (dataGridView.SelectedRows.Count > 0))
{
dataGridView.Rows.RemoveAt(dataGridView.CurrentCell.RowIndex);
+
+ SaveDataGridView();
}
}
@@ -1041,8 +1050,10 @@
{
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
- FritzBox.ImportFritzBoxMonitor(openFileDialog.FileName);
+ int count = FritzBox.ImportFritzBoxMonitor(openFileDialog.FileName);
RefreshDataGridView();
+
+ MessageBox.Show("Import done!\nAdded " + count.ToString() + " new CallerIDs to phonebook.");
}
}
@@ -1071,5 +1082,10 @@
FritzBox.phonebook.Add(caller);
}
}
+
+ private void dataGridView_Sorted(object sender, EventArgs e)
+ {
+ SaveDataGridView();
+ }
}
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|