예제 #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);
        }
예제 #2
0
        public void CanCreateEmptyBufferListCollection()
        {
            BufferListCollection bcl = new BufferListCollection();

            Assert.IsNotNull(bcl);
            Assert.IsInstanceOfType(bcl, typeof(BufferListCollection));
            Assert.AreEqual(0, bcl.Count);
        }
예제 #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());
        }
예제 #4
0
        public void CanInitializeCollectionWithBlankListInInitialization()
        {
            BufferListCollection bcl = new BufferListCollection
            {
                new BufferList("List 1")
            };

            Assert.AreEqual(1, bcl.Count);
        }
예제 #5
0
 public void OutputBufferListState(BufferListCollection buffers, NavigationDirection direction, bool interrupt = true)
 {
     if (UseScreenReader)
     {
         OutputCurrentBufferItemToScreenReader(buffers, direction, interrupt);
     }
     if (UseGraphicalOutput)
     {
         OutputCurrentBufferItemGraphically(buffers);
     }
 }
예제 #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);
        }
예제 #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);
        }
예제 #8
0
 public NextBufferCommand(BufferListCollection buffersIn)
 {
     buffers = buffersIn;
 }
 public ShowItemDetailsCommand(BufferListCollection buffersIn)
 {
     buffers = buffersIn;
 }
예제 #10
0
 public PreviousBufferItemCommand(BufferListCollection buffersIn)
 {
     buffers = buffersIn;
 }
예제 #11
0
 public LastBufferItemCommand(BufferListCollection buffersIn)
 {
     buffers = buffersIn;
     _output = OutputManager.Instance;
 }
예제 #12
0
 public NewSearchCommand(BufferListCollection buffersIn)
 {
     buffers = buffersIn;
     _output = OutputManager.Instance;
 }
예제 #13
0
 public DismissBufferCommand(BufferListCollection buffersIn)
 {
     buffers = buffersIn;
     _output = OutputManager.Instance;
 }
 public RemoveFromPlaylistCommand(BufferListCollection buffers)
 {
     _buffers = buffers;
 }
예제 #15
0
 public NextTrackCommand(BufferListCollection buffersIn, PlaybackManager pbManagerIn)
 {
     buffers         = buffersIn;
     playbackManager = pbManagerIn;
 }
예제 #16
0
 public ActivateBufferItemCommand(BufferListCollection buffersIn, PlaybackManager pbManagerIn)
 {
     buffers         = buffersIn;
     playbackManager = pbManagerIn;
     _output         = OutputManager.Instance;
 }
예제 #17
0
 public AddToPlaylistCommand(BufferListCollection buffers)
 {
     _buffers = buffers;
 }
예제 #18
0
 public AddToQueueCommand(BufferListCollection buffersIn)
 {
     this.buffers = buffersIn;
     _output      = OutputManager.Instance;
 }
예제 #19
0
 public TrayIconMenuManager(BufferListCollection buffers, Dictionary <string, Blindspot.Commands.HotkeyCommandBase> commands, NotifyIcon trayIcon)
 {
     _buffers  = buffers;
     _commands = commands;
     _trayIcon = trayIcon;
 }