I would like to simply launch the MediaPlayerLauncher task, but I would like to use media that is already on the WP7 device. From my research it seems that to use this task, one must first include media packaged as a resource, or use media that is saved in the applications isolated storage. Is there a way to only use the phone's isolated storage so that the MediaPlayerLauncher task may load using media from the default media player application (for instance if a user places music on a phone from his or her computer, that media would be recognized and loaded into the MediaPlayerLauncher).
Basically what I would like to accomplish in the end is for the WP& default media player to load as it does when a user clicks the tab, although if the user wants to select music, the music section would load instead of the default zune section. Is this even the right task to accomplish this, and if not is there a way to use default phone functionality like this? If not, is there another option?
Documentation seems to suggest that it is perfectly possible.
http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks.mediaplayerlauncher(v=VS.92).aspx
The property location takes enumeration which allows Data - ie in Isolated Storage.
Create a Uri (relative) set the Location and give it a go.
Related
I am trying set my app background images, same as Windows 10 background image.
How could I get the current wallpaper image in my app ?
I found UserProfilePersonalizationSettings API, which can set the wallpaper but I am trying to get access to the current wallpaper.
Unfortunately you cannot access the current wallpaper, only set it. If your app sets the wallpaper, you could store it separately to know which one you saved the last time.
If your app requests the Broad filesystem access restricted capability, you could alternatively take a peek in the C:\Users\[username]\AppData\Roaming\Microsoft\Windows\Themes\CachedFiles folder to find the currently set wallpaper image, but declaring this capability is recommended only in case the app has good reason to do so.
I'm developing a Media Player Windows Store app, I need to make this app be suggested by Windows when the user tries to open a media file, I never tried to do this on other platforms (WPF, WindowsForms) I know that there are answers around here explaining how to do that in those technologies, but I'm new to this and I'm not sure if it works the same, I appreciate your help.
You need to specify the file types you support in the manifest (you can do this in VS) and then add a handler for when your app is launched this way.
See here for the details: http://msdn.microsoft.com/library/windows/apps/hh779669.aspx
I was wondering if there was a way to create an app where a user is able to take a song from their wp7 music library and have the app copy it to put into isolated storage.
I have an idea for a music editing app but am unable to find if it's even possible for a user to select his or her own music from the device to use.
(sorry for this not being a coding question... I can assure you there will be some down the line)
No, I don't think this is possible. You can get access to the song in order to play and pause it, but you can't get access to the raw data in the current SDK. (Which means you won't be able to copy the data to isolated storage).
I would like to know if it is possible to mute only a specific window. For example I have got Firefox open and two more windows. I want to mute everything related to Firefox but not the whole sound of my computer.
Is this possible? If so, how can it be done?
look, basically, there isn't any relation between the window handle and the sound which something in its code is playing.. the audio card can't tell who wants it to play.
theoretically, there is an option to do what you want on web browsers, but it's not easy, and not 100%. it goes like this:
most of the audio that is playing from browsers are from known objects like wmp/quick time/vlc/flash/etc..
when the user will choose to mute all audio from firefox, your application will search those known objects in the firefox tabs, and mute/unmute them using their api.
in order to do that, you will need to write an extension to firefox, so you could have an access to the tabs memory from your application.
btw, what os?
and check this out: http://www.indev.no/?p=projects#flashmute (flashmute) i believe it does what is said - only for flash.
On Vista/Windows 7:
I expect there to be some API which can change the volume on a per process basis which the audiomanager uses. Should be relatively straight forward to use.
On XP
I don't think there is any built in functionality for what you want to do. I recommend just not offering that feature on XP. But if you really want to, there are some hackish solutions:
Usermode API hooking. Intercept the calls to audioapis with your own functions. These change the volume or manipulate the audiosignal so you get what you want. You need to do this differently for any of the several available audio-apis. I guess DirectSound and DirectShow are particularly annoying. And this requires injection of a dll into any process you want to manipulate. And this dll better not require the .net runtime. Search for IAT(import address table) or EAT(export address table) hooking.
Kernel mode audio hooking. Write a driver which intercepts the audio in the kernel and changes it on a per process basis. No clue how to do that.
But as you can see both solutions aren't good.
I am looking for a way to set/change default input device inside my application. I have several different recording devices and it is very anoying to go into the control panel and change default recording device. I was looking around and I did not find anything that could help me with the problem. Application is written in c# and it is targeted for Windows Vista / Windows 7.
This can now (actually for quite some time already) be done very easily using the AudioSwitcher.AudioApi.CoreAudio NuGet package.
Simply create a new CoreAudioController:
var controller = new AudioSwitcher.AudioApi.CoreAudio.CoreAudioController();
Get hold of the desired device using its GUID:
var device = controller.GetDevice(Guid.Parse(...));
And lastly set it as the default playback device:
controller.DefaultPlaybackDevice = device;
Note: this answer was also posted under this question.
There is no public API to do this in Vista/7 AFAIK.
For a media center launch thing I created, I had to open the control panel and send keys to the dialog, a big ugly hack, but it's the best you can do. (Or run .net reflector on media center (It is able to change it, using undocumented calls))
If you had Windows XP, apparently, you can do this by editing the registry. The key HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper\Playback contains the name of the current default playback device.