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

How can a product achieve explosive growth in users?

Competition among Internet products is essentiall...

What are the differences between chargers of different sizes?

"Chargers come in different sizes. Are there...

Black Hat Douyin Store Number Matrix Project [Paid Article]

Black Hat Douyin Store Number Matrix Project [Pai...

Don't take the hot weather lightly, heat stroke is not a trivial matter

Author: Wang Changyuan, Chief Physician, Xuanwu H...

Simple-side-drawer implements the side menu

introduce Implement the drawer view (slide out me...

Hot selling product? 2 public traffic pools, 8 ways to divert traffic!

Do you believe it? Everything in the world will g...

Mineral water has a strange taste? It's not your illusion

Review expert: Zhu Guangsi, member of Beijing Sci...

This generation of young people rely on "sound massage" to help them sleep

Difficulty falling asleep, shallow sleep, dreamin...

Tmall Double 11 event marketing tactics!

On Double 11 in 2019, Tmall’s final transaction v...