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

Catching toads and geckos? "Punishment"! Very "punishing"!

Do you remember the news that "Two men were ...

How to use classified information for online marketing promotion?

Classified information promotion refers to activi...

Analysis of the "Fan Deng Reading" activity

The case analysis brought to you today is Fan Den...

Emotional Worry-solving Society - Love Guide

Emotional Worry-Resolving Society - Love Guide Res...

AMOLED will surpass LCD in 2019, and the China-South Korea war is imminent

We all know that the iPhone X, the least popular ...

In the Internet age, let users help you build and promote your brand

People of different eras created big brands that ...

In-depth analysis of PPC advertising and PPC advertising strategies

Not only do you need to know where you’re going t...

Do shared electric bikes appearing on Beijing streets again have a future?

Recently, a group of uniform yellow electric bicy...