| 20 | namespace MediaInfoLib_MSCS |
| 21 | { |
| 22 | public class CLI |
| 23 | { |
| 24 | [STAThread] |
| 25 | static void Main(string[] Args) |
| 26 | { |
| 27 | String ToDisplay; |
| 28 | MediaInfo MI = new MediaInfo(); |
| 29 | |
| 30 | ToDisplay = MI.Option("Info_Version", "0.7.0.0;MediaInfoDLL_Example_CS;0.7.0.0"); |
| 31 | if (ToDisplay.Length == 0) |
| 32 | { |
| 33 | Console.Out.WriteLine("MediaInfo.Dll: this version of the DLL is not compatible"); |
| 34 | return; |
| 35 | } |
| 36 | |
| 37 | //Information about MediaInfo |
| 38 | ToDisplay += "\r\n\r\nInfo_Parameters\r\n"; |
| 39 | ToDisplay += MI.Option("Info_Parameters"); |
| 40 | |
| 41 | ToDisplay += "\r\n\r\nInfo_Capacities\r\n"; |
| 42 | ToDisplay += MI.Option("Info_Capacities"); |
| 43 | |
| 44 | ToDisplay += "\r\n\r\nInfo_Codecs\r\n"; |
| 45 | ToDisplay += MI.Option("Info_Codecs"); |
| 46 | |
| 47 | //An example of how to use the library |
| 48 | ToDisplay += "\r\n\r\nOpen\r\n"; |
| 49 | String File_Name; |
| 50 | if (Args.Length == 0) |
| 51 | File_Name = "Example.ogg"; |
| 52 | else |
| 53 | File_Name = Args[0]; |
| 54 | MI.Open(File_Name); |
| 55 | |
| 56 | ToDisplay += "\r\n\r\nInform with Complete=false\r\n"; |
| 57 | MI.Option("Complete"); |
| 58 | ToDisplay += MI.Inform(); |
| 59 | |
| 60 | ToDisplay += "\r\n\r\nInform with Complete=true\r\n"; |
| 61 | MI.Option("Complete", "1"); |
| 62 | ToDisplay += MI.Inform(); |
| 63 | |
| 64 | ToDisplay += "\r\n\r\nCustom Inform\r\n"; |
| 65 | MI.Option("Inform", "General;File size is %FileSize% bytes"); |
| 66 | ToDisplay += MI.Inform(); |
| 67 | |
| 68 | ToDisplay += "\r\n\r\nGet with Stream=General and Parameter='FileSize'\r\n"; |
| 69 | ToDisplay += MI.Get(0, 0, "FileSize"); |
| 70 | |
| 71 | ToDisplay += "\r\n\r\nGet with Stream=General and Parameter=46\r\n"; |
| 72 | ToDisplay += MI.Get(0, 0, 46); |
| 73 | |
| 74 | ToDisplay += "\r\n\r\nCount_Get with StreamKind=Stream_Audio\r\n"; |
| 75 | ToDisplay += MI.Count_Get(StreamKind.Audio); |
| 76 | |
| 77 | ToDisplay += "\r\n\r\nGet with Stream=General and Parameter='AudioCount'\r\n"; |
| 78 | ToDisplay += MI.Get(StreamKind.General, 0, "AudioCount"); |
| 79 |
nothing calls this directly
no outgoing calls
no test coverage detected