The battle of programs is so cute that it makes you bleed!

The battle of programs is so cute that it makes you bleed!

I am very happy that my first blog has received widespread praise and was fortunately selected as an editor's recommendation. It seems that not only is my life as a programmer quiet and happy, but my blogging career is also quiet and good! I will still post my masterpiece: "The Quiet Joy of a Programmer's Life". I still have to be high-profile, just in case it becomes popular? Don't you agree?

1. Introduction

The program in everyone's eyes is first like this:

  1. namespace OMCS.Passive
  2. {
  3. // Summary:  
  4. // Basic interface of multimedia device manager. Used to manage all local multimedia devices.  
  5. public   interface IMultimediaManager : IDisposable
  6. {
  7. //  
  8. // Summary:  
  9. // Whether to automatically adjust the video encoding quality based on audio feedback and video frame loss.  
  10. bool AutoAdjustCameraEncodeQuality { get; set; }
  11. //  
  12. // Summary:  
  13. // Whether to automatically reconnect after disconnection.  
  14. bool AutoReconnect { get; set; }
  15. //  
  16. // Summary:  
  17. // Voice and video chat group entry.  
  18. IChatGroupEntrance ChatGroupEntrance { get; }
  19. //  
  20. // Summary:  
  21. // Whether to output the audio collected by the microphone to the Guest.  
  22. bool OutputAudio { get; set; }
  23. //  
  24. // Summary:  
  25. // Whether to output the desktop image to the Guest. The default value is true.  
  26. bool OutputDesktop { get; set; }
  27. //  
  28. // Summary:  
  29. // Whether to output the video collected by the camera to the Guest. The default value is true.  
  30. bool OutputVideo { get; set; }
  31. //  
  32. // Summary:  
  33. // When the channel is busy, the video frames taken (from the camera) are discarded by the model. The default value is DiscardWhenNeed.  
  34. FrameDisardedMode VideoFrameDisardedMode { get; set; }
  35. //  
  36. // Summary:  
  37. // The audio frame just captured from the microphone.  
  38. event CbGeneric< byte []> AudioCaptured;
  39. //  
  40. // Summary:  
  41. // The audio frame just played.  
  42. event CbGeneric< byte []> AudioPlayed;
  43. //  
  44. // Summary:  
  45. // Establish a connection with the multimedia server and initialize the local multimedia manager. If the connection with the server fails, a network exception will be thrown.  
  46. void Initialize(string userID, string password, string serverIP, int serverPort);
  47. //  
  48. // Summary:  
  49. // Is the P2P channel established with the target user?  
  50. bool IsP2PChannelExist(string destUserID);
  51. }
  52. }

But you don't know that they are actually like this in my eyes——

2. Program Wars

1. The so-called: "OMCS multimedia manager, used to manage all local multimedia devices." Actually means this:

2. The so-called Boolean type attributes are actually switches, like this:

2. The so-called method is actually a button, like this:

3. The so-called events are actually slots, like this:

4. The so-called Boolean read-only attributes are actually indicator lights, like this:

5. The other four connectors can be like this:

3. Cute and bloody

Finally, assemble all the parts together to form an OMCS client. Isn’t it cute?

By using figurative thinking, we can make the originally abstract, boring and meticulously analyzed code become fresh, vivid and interesting. You can also learn from it when understanding the program.

<<:  Some tips for iOS development

>>:  Facebook launches virtual robot assistant 'M'

Recommend

"Mummy" plant? Let's see the 15 million-year-old Chinese jujube!

Author: Liu Yun, Wang Zixi, Tan Chao, Wang Guanqu...

India wants to make iPhones? Apple has seven requirements

India is the second largest smartphone market afte...

The transmission and response mechanism of touch events in iOS

All inherited responder objects UIResponder can r...

A guide to co-branding marketing!

A short and fat yellow body, a flat mouth, and ha...

15-Day Full Body Fat Burning Transformation Camp

15-Day Full Body Fat Burning Transformation Camp ...

Who can put an end to the prestige of the “4G Overlord Package”?

According to the China Consumers Association, it ...

Top 10 rules for short video operations to become a hit!

How to do short video marketing? Are there more w...