Meeskond "Põhi lax!"

From ICO wiki
Revision as of 13:04, 24 May 2010 by Tojamets (talk | contribs)
Jump to navigationJump to search

Projekt

Meediaplayer

Projekti ülesanded

  • Koostada XML schema
  • Ehitada veebiteenus
  • Ehitada selle veebiteenuse peale veebirakendus

Projekti liikmed

  • Sergei Podust
  • Jüri-Joonas Kerem
  • Urmas Sepp
  • Tiit Ojamets
  • Indrek Eiche
  • Silver Kuusik
  • Alar Järvesoo

Dokumentatsioon

Kasutades Windows Media Player klasse (wmp.dll) tegime oma klassi, mis korjab välja meie jaoks vajaliku funktsionaalsuse wmp.dll-ist ja lisab meile sobiva loogika. Meie loodud uus klass võimaldab sorteerida playlisti loo nime ja autori järgi, mis on playlisti autori eeldefineeritud. Veel on võimalik lugu kerida, heli tugevust sättida, mutet sättida, panna lood loopima, panna lood shufflema, mängida eelmist järgmist lugu ja pausida.

Meie projekti põhimõte seisneb siis selles, et kasutaja tuleb meie veebilehele, registreerib end ja loob omale playlisti. Ta saab oma playlisti muuta ja niisama vaadata. Kui ta oma playlisti salvestab saab ta omale lingi xmli asukohast meie serveris. Seda linki on ka siis võimalik kasutada playeriga. Player küsib selle lingiga meie veebiteenuselt omale playlisti ja playeris on võimalik siis neid lugusid mängida.

Töökäik

26.03 - 02.04

  • Projekti läbirääkimine teamis, milline võiks asi välja näha.

03.04 - 09.04

  • Tegime XML'i mis talletas infot, muusika listidest.
  • XML Schema.

10.04 - 16.04

  • Rakenduse loomine.
  • Teenuse loomine.
  • Playlisti lugude lisamine.

17.04 - 23.04

  • Playlistide salvestamine.
  • Veebiteenus.
  • Veebilehelt saab vaadata playlisti.
  • Rakenduse GUI


Playeri funktsioonid

  1. getGenList
  2. getPlaylist
  3. getTrackDurationString
  4. getTrackIndex
  5. getTrackPositionString
  6. get_IsPlaying
  7. get_IsReady
  8. get_IsStopped
  9. get_Loop
  10. get_Mute
  11. get_PlaylistItems
  12. get_Shuffle
  13. get_TrackDuration
  14. get_TrackLocation
  15. get_Volume
  16. initPlayList
  17. initialize
  18. pause
  19. play
  20. playNext
  21. playPrevious
  22. set_Loop
  23. set_Mute
  24. set_Shuffle
  25. set_TrackLocation
  26. set_Volume
  27. sortByArtist
  28. sortBySongName
  29. stop

Playlist worker

  1. generateMusicList
  2. isValidXML

XML

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="../../sheets/html.xslt"?>
<items>
  <playlist_info>
    <name>Minu list</name>
    <description>Minu muusikalist - rokki ja kantrit</description>
  </playlist_info>
  <item>
    <songName>No Woman, No Cry</songName>
    <location>http://www.mt.net.mk/mediacorner/mp3/Bob%20Marley%20-%20No%20Woman%20No%20Cry%281%29.mp3</location>
    <artist>Bob Marley</artist>
  </item>
  <item>
    <songName>In the End</songName>
    <location>http://culture.dyu.ac.kr/lec/files/Linkinpark%20-%20In%20The%20End.mp3</location>
    <artist>Linkin Park</artist>
  </item>
  <item>
    <songName>Benny Hill</songName>
    <location>http://www.ezarchive.com/dusted21/AlbumSpace/6ASPF6AAO0/Yakety+Sax+-+Benny+Hill.mp3</location>
    <artist>Yakety Sax</artist>
  </item>
</items>

XML Schema

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="MusicList"
                  targetNamespace="http://tempuri.org/MusicList.xsd"
                  elementFormDefault="qualified"
                  attributeFormDefault="qualified"
                  xmlns="http://tempuri.org/MusicList.xsd"
                  xmlns:mstns="http://tempuri.org/MusicList.xsd"
                  xmlns:xs="http://www.w3.org/2001/XMLSchema"
                  xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">

  <xs:element name="MusicListItems" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
	<xs:complexType>
	  <xs:sequence>
	      <xs:element name="playlist_info" maxOccurs="1" minOccurs="1" >
      <xs:complexType>
	<xs:sequence>
	  <xs:element name="name" type="xs:string" maxOccurs="1" minOccurs="1" />
	  <xs:element name="description" type="xs:string" maxOccurs="1" minOccurs="1" />
	</xs:sequence>
      </xs:complexType>
    </xs:element>	
    
            <xs:element maxOccurs="unbounded" name="item">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="artist" type="xs:string" maxOccurs="1" minOccurs="1" />
                  <xs:element name="songName" type="xs:string" maxOccurs="1" minOccurs="1" />
                  <xs:element name="location" type="xs:string" maxOccurs="1" minOccurs="1" />
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
  </xs:element>
</xs:schema>

XSLT

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>

  <xsl:template match="/">
      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
        <head>
          <title>
            <xsl:value-of select="items/playlist_info/name"/>
          </title>
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
          <meta name="author" content="Põhi lax!" />
          <style type="text/css">
            /*
            "GENERAL" - main styles.
            "PAGE" - page styles.
            "HEADER" - header styles.
            "CONTENT" - content styles.
            "FOOTER" - footer styles.
            */



            /* ---------------- GENERAL ----------------- */
            body {
            padding: 0;
            margin: 0;
            text-align: center;
            background-color: #333333;
            height: 100%;
            }

            html, body, h1, h2, h3, h4, h5, h6, p, img {
            margin: 0;
            padding: 0;
            border: 0;
            }

            table, td, th {
            font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
            font-size: 100%;
            }

            ul, ol, li {
            margin-top: 0px;
            margin-bottom: 0px;
            }

            .hidden {
            display: none;
            visibility: hidden;
            }

            .clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
            clear: both;
            height: 0;
            font-size: 1px;
            line-height: 0px;
            }



            /* ---------------- PAGE ------------------ */
            #page {
            text-align: left;
            font-size: 1em;
            width: 100%;
            margin: 0 auto;
            position: relative;
            }

            #holder {
            min-width: 970px;
            max-width: 1300px;
            margin: 0 auto;
            padding: 10px;
            position: relative;
            }



            /* -------------- HEADER --------------------- */
            #header {
            text-align: center;
            color: #fff;
            }

            #header h1 {
            color: #CCCCCC;
            }

            /* ---------------- CONTENT ------------------- */
            #content {
            margin: 0 0 0 0px;
            padding: 0 0 0 0px;
            }

            /* CONTENT - default */
            #content h1, #content h2, #content h3, #content h4, #content h5, #content h6 {
            font-family: Verdana, Arial, Helvetica, sans-serif;
            margin: 0 0 15px 0;

            }

            #content ol {
            }

            #content ul {
            }

            #content table {
            border: 2px solid #666666;
            }

            #content td, #content th {
            padding: 0px;
            color: #FFFFFF;
            text-align: center;
            }

            #content td {

            }
            #content th {
            color: #CCCCCC;
            font-weight: bold;
            border-bottom: 2px solid #666666;
            }


            /* CONTENT - others */



            /* ---------------- FOOTER -------------------- */
            #footer {
            font-size: 0.7em;
            text-align: center;
            }

            #footer li {
            list-style-type: none;
            text-align: center;
            display: inline;
            color: #999999;
            }

            #footer li a {
            color: #0000FF;
            text-decoration:none;
            }

            #footer li a:hover {
            text-decoration: underline;
            }

            #footer span {
            padding:0 4px;
            color: #666666;
            }
            a {
              color: gray;
              font-family: "Times New Roman";
            }
          </style>
        </head>
        <body>
          <!-- page start -->
          <div id="page">

            <!-- holder start -->
            <div id="holder">
              <!-- header start -->
              <div id="header">
                <h1><xsl:value-of select="items/playlist_info/name"/></h1>
                <hr/>
                <p>
                  <b>Listi info:</b>
                  <br />
                  <xsl:value-of select="items/playlist_info/description"/>
                </p>
              </div>
              <!-- header end -->
              <!-- content start -->
              <div id="content">
                <table style="width: 100%">
                  <tr>
                    <th>Laulu nimi</th>
                    <th>Asukoht</th>
                    <th>Artist</th>
                  </tr>
                  <xsl:for-each select="items/item">
                    <tr>
                      <td>
                        <xsl:value-of select="songName"/>
                      </td>
                      <td>
                        <a>
                          <xsl:attribute name="href" >
                          <xsl:value-of select="location" />
                          </xsl:attribute>
                          Ava Lugu
                        </a>
                      </td>
                      <td>
                        <xsl:value-of select="artist"/>
                      </td>
                    </tr>
                  </xsl:for-each>
                </table>
              </div>
              <!-- content end -->
              <br class="clearfloat" />
              <!-- footer start -->
              <div id="footer">
                <ul>
                  <li>© 2010 Põhi lax! </li>
                </ul>
              </div>
              <!-- footer end -->
            </div>
            <!-- holder end -->
          </div>
          <!-- page end -->
        </body>
      </html>
    </xsl:template>
</xsl:stylesheet>