Ejemplo n.º 1
0
        private void UpdateImagePathContainer()
        {
            if (_imagePathContainer.Count <= 0)
            {
                try
                {
                    GuIelementImgCoverArt.Dispose();
                    GuIelementImgCoverArt.SetFileName(GUIGraphicsContext.Skin + @"\media\missing_coverart.png");
                    GuIelementImgCoverArt.AllocResources();
                }
                catch (Exception ex)
                {
                    GuIelementImgCoverArt.Dispose();
                    Log.Debug("GUIMusicPlayingNow: could not set default image - {0}", ex.Message);
                }
            }

            if (g_Player.Duration > 0 && _imagePathContainer.Count > 1)
            {
                //  ImageChangeTimer.Interval = (g_Player.Duration * 1000) / (ImagePathContainer.Count * 8); // change each cover 8x
                _imageChangeTimer.Interval = 15 * 1000; // change covers every 15 seconds
            }
            else
            {
                _imageChangeTimer.Interval = 3600 * 1000;
            }

            _imageChangeTimer.Stop();
            _imageChangeTimer.Start();
        }
Ejemplo n.º 2
0
        private void FlipPictures()
        {
            //// Check if we should let the visualization window handle image flipping
            //if (_usingBassEngine && _showVisualization)
            //    return;

            if (GuIelementImgCoverArt != null)
            {
                if (_imagePathContainer.Count > 0)
                {
                    GuIelementImgCoverArt.Dispose();
                    if (_imagePathContainer.Count > 1)
                    {
                        var currentImage = 0;
                        // get the next image
                        foreach (var image in _imagePathContainer)
                        {
                            currentImage++;
                            if (GuIelementImgCoverArt.FileName == image)
                            {
                                break;
                            }
                        }
                        if (currentImage < _imagePathContainer.Count)
                        {
                            GuIelementImgCoverArt.SetFileName(_imagePathContainer[currentImage]);
                        }
                        else
                        {
                            // start loop again
                            GuIelementImgCoverArt.SetFileName(_imagePathContainer[0]);
                        }
                    }
                    else
                    {
                        GuIelementImgCoverArt.SetFileName(_imagePathContainer[0]);
                    }
                    GuIelementImgCoverArt.AllocResources();
                }
            }
        }