I need to check when a specific application (that I known) access to a specific file (that I know)
In short I need to hook an external application to see when start to play a scecific wav file.
I like to track "before" or "during" but not "after" play the file.
To try to do it, I have imported this code on a console application:
Github Code
to do a test I have inserted this code;
var list = DetectOpenFiles.GetOpenFilesEnumerator(4780);
while (list.MoveNext())
Console.WriteLine(list.Current.FullName);
on main module where 4780 is the PID of a mediaplayer that play a wav file.
At debug (list.Current.FullName) I see only the file dependence but don't show me the wav file opened.
After show the first 2/3 debug lines the application crash (out of memory).
If I press F5 without debug the application crash (out of memory).
There is an easy to track when an external application play a specific wav file ?
I apologize in advance for the bad English because I am a French speaker.
I would like help on a problem regarding the creation and management of DLCs with AssetBundles on unity.
Here's what I would like to do:
I create a game with just one scene (Sceneloader) which is responsible for downloading AssetBundles via a defined list and just loading the scenes, it works as follows:
At launch it downloads a list (containing the name of the assetBundles, its hash code, its version, and its download link), it then checks if the assetBundles already exists in memory if it is the case it checks the hash version etc... if they are identical it does nothing, if not it downloads a new version and saves on the disk. If the file does not exist it downloads and saves to disk,
After loading the assetBundles which contains the scenes and the other prefabs and other is instantiated directly to the loading of the scenes which are in the prefabs.
In my list there are currently two assetBundles (one containing the scenes and another containing the prefabs, image, sound etc...)
So what I would like to do:
In the first version of the assetBundles, I would like to send the mainCharacter and two enemies plus some other prefabs in an asset bundles called "MAINASSET", and Two scenes in another asset bundles called "ALLSCENE".
In the second version I would like to send just my mainCharacter (which has been modified) and two scenes (including a new scene and a modified scene2).
All I would like it to be saved on the disk and not just in the cache so that if there is no internet connection we launch the game, or that the items are not downloaded twice. So if there's an internet connection he downloads the list and sees if anything has changed.
If it has changed, it updates the game and saves the update on the disk in this way if there is no internet connection the game can still start being up to date since it is already downloaded the problem is that I don't know how to take to create this second part because I would like the client of the game to have downloaded only the necessary.
in my uwp app I am getting video files from KnownFolder.VideoLibrary and I am using QueryOptions to get them, so taking advantage of that I am trying to use AdvancedQuerySyntax so that I only get video files, but I am actually getting subtitle files like srt as well. what am I doing wrong here? is the AQS syntax I wrote wrong? I think subs files are also considered as video files according to this syntax, is there a way I can narrow it down to getting only video files excluding subtitle files? or can I get a link to docs where I can know what is the list of extension types, this syntax actually will return? So I can manage it accordingly?
CODE
videoFileOptions = new QueryOptions()
{
IndexerOption = IndexerOption.OnlyUseIndexerAndOptimizeForIndexedProperties//check sort order later
};
string videoFilter = "System.Kind:=System.Kind#Video";
videoFileOptions.ApplicationSearchFilter += videoFilter;
videoFileOptions.SetPropertyPrefetch(PropertyPrefetchOptions.VideoProperties, RequiredVideoProperties);
videoFileOptions.SetThumbnailPrefetch(ThumbnailMode.VideosView, thumbnailRequestedSize, ThumbnailOptions.UseCurrentScale);
This is the line where I am providing the filter.
string videoFilter = "System.Kind:=System.Kind#Video";
Short answer: .srt and other subtitle files are classified as video files since any app supporting playback might want access to srt files.
You can add an application search filter ext:<>.srt to remove srt files from your results.
Long Answer: The inevitable question is why not have another type for Kind:Subtitles or something? Why include them for with Kind:Video?
Well there is another pressure that goes on the Kind mappings beyond just "does this extension make sense as a video"? It all comes back to the SD card access on Windows Phone.
See for Windows 8 an modern app accessing the SD card had to declare a file launch experience for any file type they wanted to see on the SD card. For example that meant that a video app would need a file launch experience for mp4, avi, ect. However, on Windows Phone this wouldn't work because there was no way for an app to override the default system app for mp4 or avi (there is another story here for another day). So we needed another way to give apps access to mp4 files on the SD card.
The solution was that since the UI already said "Grant this app access to Videos and your SD card" then any app with both the video library capability and SD card access should have access to all files of Kind.Video on your SD card. Thus Kind.Video not only meant "Video files" but also "Files a video app would want access to".
With this slightly changed definition, it meant that any files the built in video player needed were suddenly included in the Kinds.Video mapping. Which is where .srt files come from in the mapping.
And as one of the people responsible for making the kind mapping decisions, I'd like to take this opportunity to apologize my mess and promise I'm not nearly as brain dead as you'd think looking at this design. Probably
Don know how to go about this. I have about 12 videos which has to be added to the player and play on after the other. Right now only one video is getting played.
Following is the piece of code :
Process proc = new Process ();
foreach (string videos in Directory.GetFiles(Application.streamingAssetsPath))
{
filePath = Path.Combine (Application.streamingAssetsPath, videos);
proc.StartInfo.FileName = filePath;
proc.Start ();
}
I printed and checked files in proc.StartInfo.FileName , all the 12 videos are getting printed.But don't know how to load them into the player.
We need more details to help you out !
What video player are you using ?
Since your code starts multiple processes (bad idea IMO) and you see only one, I can assume that your player can only have one instance running and it is used again, hence you do only see one video.
Potential answer:
Probably your player accepts multiple arguments, I'll take the example of Winamp :
winamp.exe "d:\f1 race - Copy.wav" "d:\f1 race.wav"
This will start an instance of Winamp and all the files will be on the playlist.
EDIT
The same applies to WMP as well :
wmplayer.exe "d:\f1 race - Copy.wav" "d:\f1 race.wav"
Playing a folder containing medias :
It does work with Winamp but not with WMP unfortunately, so passing each media full path as above seems the only solution for WMP. I'm not sure about the maximum length you can throw
as arguments since it is not explicitly said in here.
You might wonder why dropping a folder to WMP effectively loads all the files in it ? They for sure do get all the files from the path you have dropped and add them to the playlist.
Alternatives
Maybe you should define a list of the installed media players that the user would choose the one he prefers to use. (and define a default one, in this case WMP is a good choice since there's a strong probability it is installed on the system)
You can retrieve a default application for a particular extension, see the following links :
Finding the default application for opening a particular file type on Windows
http://windevblog.blogspot.fr/2008/09/get-default-application-in-windows-xp.html
There is also the DropTarget route though it might not be straightforward, here's a sample from MSDN : http://msdn.microsoft.com/en-us/library/windows/desktop/dd940354(v=vs.85).aspx
I strongly suggest you to take a look at this small piece of software that helps in seeing/browsing/editing the default applications for a particular extension : http://defaultprogramseditor.com/ (must run as admin)
Hi this question or problem i have its very hard i have search and ask in the university and i have no idea how to make this happen, or even if it is possible.
Here we go...
I am making a photo or image editor with the variation of letting the user to insert buttons in top of the edited image(this buttons when clicked plays an audio file) all of this works so far.
BUT at the end when the user finish his work i need him to save it, so it can be send and view by others.
Now I think I know how to save an edited image but that dose not contain the buttons (controls) .... its like when we save a file at power point and we send it to others they contain audio and the image. Hope fully you guys understand if so can any one point me in a direction to do this or show me how if possible.
( Some people told me to use meta-data others the manifest file but I am so confuse).
too bad i cant post pictures of the work until i get 10 points......
Thanks For the first four quick response and sorry mistake of not telling that I am working on C# 3.5 .Net and in Windows Form app.
It seems you all quite understand what i am trying to do here. I will post the picture thanks to the points i receive from TheVillageIdiot. and about the XML I have never ever used that before ill try my best to understand you guys but if any one can show me an example two or were to read ( dose xml works on Windows form app.?) Here is ...( sorry if the picture its too big) an example of what the program it's doing so far that black transparent box its the MouseOverBackColor... when clicked it loads a player that plays x_x the sound. Its like tagging but with audio.
I really need help i reached my limit don't know were to look and the time is killing me.
HI I am back again this time with a simple sample of what i need to learn how to save the dinamic buttonarray
Today is 10/11/10 (i made a acount with !##$%share to share the sample with you guys i hope this dosent bother any one here) here is the Link . i will explain again what i need to do and i have no idea or code on how to do it.Imagine a person that uses the program and create like 5 buttons any were in the form , it needs to be save so he can send it to others that have the same program, this way others can view the buttons the user created.
hopefully you guys can help me out with a simple example i really neeed some sample working code. Note: I am working on windows form app WFA C# 3.5 .net M.V.studio2010 (the file I gave above has a backup with a 2008 vercion) thanx in advance.
Similar to jim's answer, I would suggest having an archive of some sort (ZIP or otherwise) containing all the media necessary.
Store the images and sounds files by name or checksum in the archive and keep the meta-data (button positions, names, what media they use, etc, we'll call it the definition file) in a file also stored in the archive. You may be able to use XML to make that human-readable.
The entire package will then be simple to distribute and use, as everything will be contained in the archive. Your application simply needs to scan for archives, check each archive for a valid definition file, and load the ones that are needed.
Edit: Going from the screenshot you posted and my understanding of the problem, I'm going to suggest the following:
When a user creates a button (defined as a rectangular area or "hotspot"), open a dialogue asking for a sound file to associate. Then, store the top-left and bottom-right corners of the button and the filename in a XML file, something like this:
<Button name="myButton!">
<Position top="128" left="128" />
<Size height="200" width="200" />
<Audio filename="something.mp3" />
</Button>
Now, when compiling a plugin, create a ZIP archive. Inside, place the XML file and all the audio files you need.
When loading a plugin, read the XML file first and find the audio file (assume all audio files are in the same archive as the XML file). Then create the button and add the audio filename as, say, its Tag property. Assign all buttons one generic OnClick event, and in the OnClick event, play the audio file given by the current object's Tag.
If you don't understand what I mean, I'll try to elaborate further. I think that method should work neatly and be pretty simple to work with. :)
One solution: Create a ZIP file that contains both audio and images.
Basically, you've got two things you want to save.
The edited image, and then the locations of the buttons and their actions.
You've got the image-saving part happening, so now you need to save the other information. This can be considered "metadata", and you can save it in some format that you invent, such that it allows you to load it back. Typically it would be easiest to do this via XML Serialization. So look into that.
Assuming you are writing a stand-alone application and no web - application.
If you are adding the Button as a .NET component (new Button()) there is no way to do that unless you supply your own player software with it.
If you want to supply your own player, create a (seperate) file with the info about the button and read the file and then re-create the button.
(Be aware though that all the resources - jpeg, mp3) also have to be available at the target PC) Alternatively, pack all you info into one file (jpeg, button infos, mp3's) and save that file.
hth
Mario
You have two choices
Create your own format and then make a player app that read it and play the results
Find some format that supports your features and create that kind of file. This works well if you expect others to have a player.
For #2, here are some formats that could support what you want to do
Flash
PDF
Compiled HTML Arhive -- need IE to play http://en.wikipedia.org/wiki/MHTML
EXE -- create code with resources and compile it -- basically your player + resources
PowerPoint