Ejemplo n.º 1
0
 private void Reset()
 {
     IsPlaying  = false;
     Percentage = 0;
     Time       = "";
     PlayStatus = "";
     Type       = "";
     Song       = new MusicSong();
 }
Ejemplo n.º 2
0
 public XBMC_NowPlaying(XBMC_Communicator p)
 {
     parent         = p;
     Song           = new MusicSong();
     FistTime       = true;
     timer          = new Timer();
     timer.Interval = 1000;
     timer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
     timer.Enabled  = true;
     timer.Start();
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Retourne les infos de la piste à partir de chemin
        /// </summary>
        /// <param name="_FileName"></param>
        /// <returns></returns>
        public MusicSong GetSongByFileName(string _FileName)
        {
            MusicSong _Song = new MusicSong();

            string[] _Infos = parent.Request("QueryMusicDatabase", "SELECT idSong FROM song left join path on song.idPath = path.idPath where strPath || strFilename = '" + _FileName + "'");
            if (_Infos != null)
            {
                if (_Infos[0] != "")
                {
                    _Song = GetSongByID(Convert.ToInt32(_Infos[0]));
                }
            }
            return(_Song);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Retourne les infos de la piste à partir de son id
        /// </summary>
        /// <param name="_IDSong"></param>
        /// <returns></returns>
        public MusicSong GetSongByID(int _IDSong)
        {
            MusicSong _Song = new MusicSong();

            string[] _Infos = parent.Request("QueryMusicDatabase", "SELECT idSong, strTitle,idAlbum,idArtist,strPath,strFilename,strgenre,iTrack,iDuration,iYear,strthumb FROM song left join thumb on song.idthumb = thumb.idthumb left join path on song.idPath = path.idPath left join genre on song.idGenre = genre.idGenre where idSong = " + _IDSong);
            if (_Infos != null)
            {
                _Song.IdSong   = Convert.ToInt32(_Infos[0]);
                _Song.Title    = _Infos[1];
                _Song.Album    = GetAlbumByID(Convert.ToInt32(_Infos[2]));
                _Song.Artist   = GetArtistByID(Convert.ToInt32(_Infos[3]));
                _Song.Path     = _Infos[4];
                _Song.Filename = _Infos[5];
                _Song.Genre    = _Infos[6];
                _Song.Track    = Convert.ToInt32(_Infos[7]);
                //Convertion en int
                _Song.Track    = (_Song.Track / 65537) + ((_Song.Track % 65537));
                _Song.Duration = Convert.ToInt32(_Infos[8]);
                _Song.Year     = Convert.ToInt32(_Infos[9]);
                _Song.Thumb    = parent.Media.GetThumbByPath(_Infos[10]);
            }
            return(_Song);
        }