VSX-5 VSXMusic encoding music, vsx-5vsxmusic

Source: Internet
Author: User

VSX-5 VSXMusic encoding music, vsx-5vsxmusic

I wrote an extension for VS to listen to music. For a long time, I made a first version in the past two days. I used Douban FM and sent it out first.

The plug-in is only available in VS2013, and other versions need to be supported in the next step.

Currently, there is only one Adornment (that is, the one with the cover), one Margin (bottom of the editor, which is used to put the lyrics, but not done), and one Menu (top Menu ), a ToolBar (ToolBar, which indicates PLAYING ).

Only the playback function has been completed. You have prepared to switch the channel tomorrow, And the login function will be improved later.

There are also many people who have done some work on the WPF program of Douban FM. Here, I will refer to and continue to refer to the two projects, as listed here: Smoke ash and kfstorm

I am disgusted with DI and IoC, but I use it without knowing it.

In fact, it is very simple to do this VS extension. There are very few things related to the extension. Here we will do what the application should do, but the program written is not the running subject.

However, there are still a lot of work to be done in the future. First, the Adornment should not include one in each TextView. That is to say, there should be only one VS, so the IWpfTextViewCreationListener interface should not be used here.

In other words, expansion is very common for VS expansion and opening a few VS. You have to think about how to implement unified control and remoting.

You also need a Tool Window to make the main interface, you need an Options Page, you also need to get a search song in the Quick Start (Ctrl + Q), add the lyrics, users, shortcut key support, etc, in the future, some functions such as playing local music may be added.

 

Back to MEF, I maintained another IoC container in the original VSX project, but the VS extension was originally using MEF. After reading many projects, I finally found the following code snippet:

var componentModel = (IComponentModel)_serviceProvider.GetService(typeof(SComponentModel));var player = componentModel.DefaultExportProvider.GetExportedValue<IPlayer>();

The _ serviceProvider is the IServiceProvider interface object, and the most common Package in VSX is an IServiceProvider.

Of course, the class exported using Export, that is, the MEF component, can be directly injected using the Import feature.

 

This project won't take too much effort, but it's just about interest. We hope that people who are equally interested can continue to do so.

Here is the source code: https://github.com/NanQi/VSXMusic

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.