Exemple #1
0
        public BuffersWindow()
        {
            // language stuff needs to happen before InitializeComponent
            if (!settings.DontShowFirstTimeWizard)
            {
                // find out what language was used in the installer and use it for the first time wizard and everything else
                SetThreadToInstallationLanguage();
                DisplayFirstTimeWizard();
            }
            else
            {
                // if a language code is set in settings, set it on the thread
                if (settings.UILanguageCode != 0)
                {
                    Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(settings.UILanguageCode);
                }
            }
            InitializeComponent();
            InitializeTrayIcon();
            Commands                 = new Dictionary <string, HotkeyCommandBase>();
            playbackManager          = new PlaybackManager(settings.OutputDeviceID, settings.UseDirectSound);
            playbackManager.OnError += new PlaybackManager.PlaybackManagerErrorHandler(StreamingError);

            SetupFormEventHandlers();
            Buffers          = new BufferListCollection();
            _playQueueBuffer = new BufferList("Play Queue", false);
            Buffers.Add(_playQueueBuffer);
            Buffers.Add(new PlaylistContainerBufferList("Playlists", false));
            spotify = SpotifyClient.Instance;
            _trayIconMenuManager      = new TrayIconMenuManager(Buffers, Commands, _trayIcon);
            settings.PropertyChanged += new PropertyChangedEventHandler(OnUserSettingChange);
        }
Exemple #2
0
        public void CanCreateEmptyBufferListCollection()
        {
            BufferListCollection bcl = new BufferListCollection();

            Assert.IsNotNull(bcl);
            Assert.IsInstanceOfType(bcl, typeof(BufferListCollection));
            Assert.AreEqual(0, bcl.Count);
        }
Exemple #3
0
        private void OutputCurrentBufferItemGraphically(BufferListCollection buffers)
        {
            var    currentList = buffers.CurrentList;
            string titleString = string.Format("{0} ({1}/{2})",
                                               currentList.Name, currentList.CurrentItemIndex + 1, currentList.Count);

            OutputMessageGraphically(titleString, currentList.CurrentItem.ToString());
        }
Exemple #4
0
        public void CanInitializeCollectionWithBlankListInInitialization()
        {
            BufferListCollection bcl = new BufferListCollection
            {
                new BufferList("List 1")
            };

            Assert.AreEqual(1, bcl.Count);
        }
Exemple #5
0
 public void OutputBufferListState(BufferListCollection buffers, NavigationDirection direction, bool interrupt = true)
 {
     if (UseScreenReader)
     {
         OutputCurrentBufferItemToScreenReader(buffers, direction, interrupt);
     }
     if (UseGraphicalOutput)
     {
         OutputCurrentBufferItemGraphically(buffers);
     }
 }
Exemple #6
0
        public void CanInitializeCollectionWithNonEmptyListInInitialization()
        {
            BufferList list = new BufferList
            {
                new BufferItem(), new BufferItem(), new BufferItem()
            };
            BufferListCollection bcl = new BufferListCollection {
                list
            };

            Assert.AreEqual(3, bcl[0].Count);
        }
Exemple #7
0
        private void OutputCurrentBufferItemToScreenReader(BufferListCollection buffers, NavigationDirection direction, bool interrupt)
        {
            string textToRead;

            if (direction == NavigationDirection.Left || direction == NavigationDirection.Right)
            {
                textToRead = buffers.CurrentList.ToString();
            }
            else
            {
                textToRead = buffers.CurrentList.CurrentItem.ToString();
            }
            OutputMessageToScreenReader(textToRead, interrupt);
        }
 public NextBufferCommand(BufferListCollection buffersIn)
 {
     buffers = buffersIn;
 }
 public ShowItemDetailsCommand(BufferListCollection buffersIn)
 {
     buffers = buffersIn;
 }
Exemple #10
0
 public PreviousBufferItemCommand(BufferListCollection buffersIn)
 {
     buffers = buffersIn;
 }
Exemple #11
0
 public LastBufferItemCommand(BufferListCollection buffersIn)
 {
     buffers = buffersIn;
     _output = OutputManager.Instance;
 }
 public NewSearchCommand(BufferListCollection buffersIn)
 {
     buffers = buffersIn;
     _output = OutputManager.Instance;
 }
Exemple #13
0
 public DismissBufferCommand(BufferListCollection buffersIn)
 {
     buffers = buffersIn;
     _output = OutputManager.Instance;
 }
 public RemoveFromPlaylistCommand(BufferListCollection buffers)
 {
     _buffers = buffers;
 }
Exemple #15
0
 public NextTrackCommand(BufferListCollection buffersIn, PlaybackManager pbManagerIn)
 {
     buffers         = buffersIn;
     playbackManager = pbManagerIn;
 }
Exemple #16
0
 public ActivateBufferItemCommand(BufferListCollection buffersIn, PlaybackManager pbManagerIn)
 {
     buffers         = buffersIn;
     playbackManager = pbManagerIn;
     _output         = OutputManager.Instance;
 }
 public AddToPlaylistCommand(BufferListCollection buffers)
 {
     _buffers = buffers;
 }
Exemple #18
0
 public AddToQueueCommand(BufferListCollection buffersIn)
 {
     this.buffers = buffersIn;
     _output      = OutputManager.Instance;
 }
Exemple #19
0
 public TrayIconMenuManager(BufferListCollection buffers, Dictionary <string, Blindspot.Commands.HotkeyCommandBase> commands, NotifyIcon trayIcon)
 {
     _buffers  = buffers;
     _commands = commands;
     _trayIcon = trayIcon;
 }