diff --git a/Group-Video/OpenVideoCall-Android/.gitignore b/Group-Video/OpenVideoCall-Android/.gitignore index 00b607ce..7b6c0341 100644 --- a/Group-Video/OpenVideoCall-Android/.gitignore +++ b/Group-Video/OpenVideoCall-Android/.gitignore @@ -1,3 +1,8 @@ +include +agora-rtc-sdk.jar +*.so +.settings + # built application files *.apk *.ap_ diff --git a/Group-Video/OpenVideoCall-Android/README.md b/Group-Video/OpenVideoCall-Android/README.md index cc9ecf73..a9c8f2e7 100755 --- a/Group-Video/OpenVideoCall-Android/README.md +++ b/Group-Video/OpenVideoCall-Android/README.md @@ -9,10 +9,9 @@ With this sample app, you can: - Mute / unmute audio - Enable / disable video - Switch camera -- Send message to channel - Setup resolution, frame rate and bit rate - Enable encryption -- Enable / disable black and white filter +- Enable beautify filter ## Prerequisites @@ -53,7 +52,7 @@ The SDK must be integrated into the sample project before it can opened and buil ... dependencies { ... - implementation 'io.agora.rtc:full-sdk:2.4.1' + implementation 'io.agora.rtc:full-sdk:3.0.0' } ``` @@ -81,8 +80,13 @@ Or use `Gradle` to build and run. ## Resources -- You can find full API document at [Document Center](https://docs.agora.io/en/) -- You can file bugs about this demo at [issue](https://github.com/AgoraIO/Basic-Video-Call/issues) +- For potential issues, take a look at our [FAQ](https://docs.agora.io/cn/faq) first +- Dive into [Agora SDK Samples](https://github.com/AgoraIO) to see more tutorials +- Take a look at [Agora Use Case](https://github.com/AgoraIO-usecase) for more complicated real use case +- Repositories managed by developer communities can be found at [Agora Community](https://github.com/AgoraIO-Community) +- You can find full API documentation at [Document Center](https://docs.agora.io/en/) +- If you encounter problems during integration, you can ask question in [Stack Overflow](https://stackoverflow.com/questions/tagged/agora.io) +- You can file bugs about this sample at [issue](https://github.com/AgoraIO/Basic-Video-Call/issues) ## License diff --git a/Group-Video/OpenVideoCall-Android/README.yaml b/Group-Video/OpenVideoCall-Android/README.yaml deleted file mode 100644 index 072d434e..00000000 --- a/Group-Video/OpenVideoCall-Android/README.yaml +++ /dev/null @@ -1,52 +0,0 @@ -Meta: - name: Open Video Call for Android - # en or cn - lang: en - version: 2.4.1 - # | 代表这里是字符串 - description: | - The Open Video Call for Android Sample App is an open-source demo that will help you get video chat integrated directly into your Android applications using the Agora Video SDK. - - With this sample app, you can: - - Join / leave channel - - Mute / unmute audio - - Enable / disable video - - Switch camera - - Send message to channel - - Setup resolution, frame rate and bit rate - - Enable encryption - - Enable / disable black and white filter - -Prerequisites: - - Android Studio 3.3 or above - - Real devices (Nexus 5X or other devices) - - Some simulators are function missing or have performance issue, so real device is the best choice - -QuickStart: - description: - This section shows you how to prepare, build, and run the sample application. - sections: - - title: Obtain an App ID - content: | - $_{APPID} - 5. Update "app/src/main/res/values/strings_config.xml" with your App ID and Token. - ``` - <#YOUR APP ID#> - - - <#YOUR TOKEN#> - ``` - - title: Integrate the Agora Video SDK - content: | - $_{ANDROID_INTEGRATE} - - - title: Run the Application - content: | - $_{ANDROID_RUN} - -Resources: - document: https://docs.agora.io/en/ - issue: https://github.com/AgoraIO/Basic-Video-Call/issues - -License: - type: MIT \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Android/README.zh.md b/Group-Video/OpenVideoCall-Android/README.zh.md index 2baf4d15..259db1af 100644 --- a/Group-Video/OpenVideoCall-Android/README.zh.md +++ b/Group-Video/OpenVideoCall-Android/README.zh.md @@ -10,12 +10,9 @@ - 静音和解除静音; - 关闭摄像头和打开摄像头; - 切换前置摄像头和后置摄像头; -- 发送频道内消息; - 选择分辨率、码率和帧率; - 设置加密模式; -- 开启和关闭黑白滤镜; - -你也可以在这里查看入门版的示例项目:[Agora-Android-Tutorial-1to1](https://github.com/AgoraIO/Basic-Video-Call/tree/master/One-to-One-Video/Agora-Android-Tutorial-1to1) +- 开启和关闭基础美颜; ## 环境准备 @@ -46,14 +43,12 @@ ### 集成 Agora 视频 SDK 集成方式有以下两种: - - 首选集成方式: + - 通过JCenter集成: - 在项目对应的模块的 `app/build.gradle` 文件的依赖属性中加入通过 JCenter 自动集成 Agora 视频 SDK 的地址: ``` - implementation 'io.agora.rtc:full-sdk:2.4.1' + implementation 'io.agora.rtc:full-sdk:3.0.0' ``` - (如果要在自己的应用中集成 Agora 视频 SDK,添加链接地址是最重要的一步。) - - 在 [Agora.io SDK](https://www.agora.io/cn/download/) 下载 **视频通话 + 直播 SDK**,解压后将其中的 **libs**/**include** 文件夹下的 ***.h** 复制到本项目的 **app**/**src**/**main**/**cpp**/**agora** 下。 - - 次选集成方式: + - 手动集成: - 在 [Agora.io SDK](https://www.agora.io/cn/download/) 下载 **视频通话 + 直播 SDK**并解压,按以下对应关系将 **libs** 目录的内容复制到项目内。 SDK目录|项目目录 @@ -62,6 +57,7 @@ **arm64-v8a** folder|**/app/src/main/jniLibs** folder **x86** folder|**/app/src/main/jniLibs** folder **armeabi-v7a** folder|**/app/src/main/jniLibs** folder + - 若需要需要使用C++头文件,可以在解压SDK后将其中的 **libs**/**include** 文件夹下的 ***.h** 复制到本项目的 **app**/**src**/**main**/**cpp**/**agora** 下。 ### 启动应用程序 @@ -73,11 +69,13 @@ ## 联系我们 +- 如果你遇到了困难,可以先参阅[常见问题](https://docs.agora.io/cn/faq) +- 如果你想了解更多官方示例,可以参考[官方SDK示例](https://github.com/AgoraIO) +- 如果你想了解声网SDK在复杂场景下的应用,可以参考[官方场景案例](https://github.com/AgoraIO-usecase) +- 如果你想了解声网的一些社区开发者维护的项目,可以查看[社区](https://github.com/AgoraIO-Community) - 完整的 API 文档见 [文档中心](https://docs.agora.io/cn/) -- 如果在集成中遇到问题, 你可以到 [开发者社区](https://dev.agora.io/cn/) 提问 -- 如果有售前咨询问题, 可以拨打 400 632 6626,或加入官方Q群 12742516 提问 -- 如果需要售后技术支持, 你可以在 [Agora Dashboard](https://dashboard.agora.io) 提交工单 -- 如果发现了示例代码的 bug, 欢迎提交 [issue](https://github.com/AgoraIO/Basic-Video-Call/issues) +- 若遇到问题需要开发者帮助,你可以到 [开发者社区](https://rtcdeveloper.com/) 提问 +- 如果发现了示例代码的 bug,欢迎提交 [issue](https://github.com/AgoraIO/Basic-Video-Call/issues) ## 代码许可 diff --git a/Group-Video/OpenVideoCall-Android/README.zh.yaml b/Group-Video/OpenVideoCall-Android/README.zh.yaml deleted file mode 100644 index ab06f2cc..00000000 --- a/Group-Video/OpenVideoCall-Android/README.zh.yaml +++ /dev/null @@ -1,54 +0,0 @@ -Meta: - name: Open Video Call for Android - # en or cn - lang: cn - version: 2.4.1 - # | 代表这里是字符串 - description: | - 这个开源示例项目演示了如何快速集成 Agora 视频 SDK,实现多人视频通话。 - - 在这个示例项目中包含了以下功能: - - - 加入通话和离开通话; - - 静音和解除静音; - - 关闭摄像头和打开摄像头; - - 切换前置摄像头和后置摄像头; - - 发送频道内消息; - - 选择分辨率、码率和帧率; - - 设置加密模式; - - 开启和关闭黑白滤镜; - - 你也可以在这里查看入门版的示例项目:[Agora-Android-Tutorial-1to1](https://github.com/AgoraIO/Basic-Video-Call/tree/master/One-to-One-Video/Agora-Android-Tutorial-1to1) - -Prerequisites: - - Android Studio 3.3 + - - 真实 Android 设备 (Nexus 5X 或者其它设备) - - 部分模拟器会存在功能缺失或者性能问题,所以推荐使用真机 - -QuickStart: - description: - 这个段落主要讲解了如何编译和运行实例程序。 - sections: - - title: 创建Agora账号并获取AppId - content: | - $_{APPID} - 5. 将 AppID 填写进 "app/src/main/res/values/strings_config.xml" - ``` - <#YOUR APP ID#> - - - <#YOUR TOKEN#> - ``` - - title: 集成 Agora 视频 SDK - content: | - $_{ANDROID_INTEGRATE} - - title: 启动应用程序 - content: | - $_{ANDROID_RUN} - -Resources: - document: https://docs.agora.io/cn/ - issue: https://github.com/AgoraIO/Basic-Video-Call/issues - -License: - type: MIT \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Android/app/build.gradle b/Group-Video/OpenVideoCall-Android/app/build.gradle index c7e2d773..909fe9e2 100644 --- a/Group-Video/OpenVideoCall-Android/app/build.gradle +++ b/Group-Video/OpenVideoCall-Android/app/build.gradle @@ -45,12 +45,14 @@ dependencies { implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support:support-v4:28.0.0' implementation 'com.android.support:design:28.0.0' - implementation 'org.slf4j:slf4j-api:1.7.21' + implementation 'org.slf4j:slf4j-api:1.7.25' implementation 'com.github.tony19:logback-android-core:1.1.1-4' implementation('com.github.tony19:logback-android-classic:1.1.1-4') { // workaround issue #73 exclude group: 'com.google.android', module: 'android' } + + implementation 'io.agora.rtc:full-sdk:2.9.2' androidTestImplementation 'com.android.support.test:rules:1.0.2' androidTestImplementation 'com.jayway.android.robotium:robotium-solo:5.6.3' } diff --git a/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/AGApplication.java b/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/AGApplication.java index db047955..15bbf998 100644 --- a/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/AGApplication.java +++ b/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/AGApplication.java @@ -1,35 +1,78 @@ package io.agora.openvcall; import android.app.Application; +import android.content.Context; +import android.text.TextUtils; +import android.util.Log; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import io.agora.openvcall.model.AGEventHandler; import io.agora.openvcall.model.CurrentUserSettings; -import io.agora.openvcall.model.WorkerThread; +import io.agora.openvcall.model.EngineConfig; +import io.agora.openvcall.model.MyEngineEventHandler; +import io.agora.rtc.Constants; +import io.agora.rtc.RtcEngine; public class AGApplication extends Application { + private CurrentUserSettings mVideoSettings = new CurrentUserSettings(); - private WorkerThread mWorkerThread; + private final Logger log = LoggerFactory.getLogger(this.getClass()); + private RtcEngine mRtcEngine; + private EngineConfig mConfig; + private MyEngineEventHandler mEventHandler; - public synchronized void initWorkerThread() { - if (mWorkerThread == null) { - mWorkerThread = new WorkerThread(getApplicationContext()); - mWorkerThread.start(); + public RtcEngine rtcEngine() { + return mRtcEngine; + } - mWorkerThread.waitForReady(); - } + public EngineConfig config() { + return mConfig; + } + + public CurrentUserSettings userSettings() { + return mVideoSettings; + } + + public void addEventHandler(AGEventHandler handler) { + mEventHandler.addEventHandler(handler); } - public synchronized WorkerThread getWorkerThread() { - return mWorkerThread; + public void remoteEventHandler(AGEventHandler handler) { + mEventHandler.removeEventHandler(handler); } - public synchronized void deInitWorkerThread() { - mWorkerThread.exit(); + @Override + public void onCreate() { + super.onCreate(); + createRtcEngine(); + } + + private void createRtcEngine() { + Context context = getApplicationContext(); + String appId = context.getString(R.string.agora_app_id); + if (TextUtils.isEmpty(appId)) { + throw new RuntimeException("NEED TO use your App ID, get your own ID at https://dashboard.agora.io/"); + } + + mEventHandler = new MyEngineEventHandler(); try { - mWorkerThread.join(); - } catch (InterruptedException e) { - e.printStackTrace(); + mRtcEngine = RtcEngine.create(context, appId, mEventHandler); + } catch (Exception e) { + log.error(Log.getStackTraceString(e)); + throw new RuntimeException("NEED TO check rtc sdk init fatal error\n" + Log.getStackTraceString(e)); } - mWorkerThread = null; + + mRtcEngine.setChannelProfile(Constants.CHANNEL_PROFILE_COMMUNICATION); + mRtcEngine.enableVideo(); + mRtcEngine.enableAudioVolumeIndication(200, 3, false); + + mConfig = new EngineConfig(); } - public static final CurrentUserSettings mVideoSettings = new CurrentUserSettings(); + @Override + public void onTerminate() { + super.onTerminate(); + } } diff --git a/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/model/EngineConfig.java b/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/model/EngineConfig.java index ecfe05f7..13489df5 100644 --- a/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/model/EngineConfig.java +++ b/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/model/EngineConfig.java @@ -9,6 +9,6 @@ public void reset() { mChannel = null; } - EngineConfig() { + public EngineConfig() { } } diff --git a/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/model/MyEngineEventHandler.java b/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/model/MyEngineEventHandler.java index 4230f6c3..5cf30190 100644 --- a/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/model/MyEngineEventHandler.java +++ b/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/model/MyEngineEventHandler.java @@ -1,8 +1,5 @@ package io.agora.openvcall.model; -import android.content.Context; - -import io.agora.rtc.Constants; import io.agora.rtc.IRtcEngineEventHandler; import io.agora.rtc.RtcEngine; @@ -13,17 +10,8 @@ import java.util.Iterator; import java.util.concurrent.ConcurrentHashMap; -public class MyEngineEventHandler { - - public MyEngineEventHandler(Context ctx, EngineConfig config) { - this.mContext = ctx; - this.mConfig = config; - } - - private final EngineConfig mConfig; - - private final Context mContext; - +public class MyEngineEventHandler extends IRtcEngineEventHandler { + private final Logger log = LoggerFactory.getLogger(this.getClass()); private final ConcurrentHashMap mEventHandlerList = new ConcurrentHashMap<>(); public void addEventHandler(AGEventHandler handler) { @@ -34,236 +22,219 @@ public void removeEventHandler(AGEventHandler handler) { this.mEventHandlerList.remove(handler); } - final IRtcEngineEventHandler mRtcEventHandler = new IRtcEngineEventHandler() { - private final Logger log = LoggerFactory.getLogger(this.getClass()); - - @Override - public void onFirstRemoteVideoDecoded(int uid, int width, int height, int elapsed) { - log.debug("onFirstRemoteVideoDecoded " + (uid & 0xFFFFFFFFL) + " " + width + " " + height + " " + elapsed); + @Override + public void onFirstRemoteVideoDecoded(int uid, int width, int height, int elapsed) { + log.debug("onFirstRemoteVideoDecoded " + (uid & 0xFFFFFFFFL) + " " + width + " " + height + " " + elapsed); - Iterator it = mEventHandlerList.keySet().iterator(); - while (it.hasNext()) { - AGEventHandler handler = it.next(); - if (handler instanceof DuringCallEventHandler) { - ((DuringCallEventHandler) handler).onFirstRemoteVideoDecoded(uid, width, height, elapsed); - } + Iterator it = mEventHandlerList.keySet().iterator(); + while (it.hasNext()) { + AGEventHandler handler = it.next(); + if (handler instanceof DuringCallEventHandler) { + ((DuringCallEventHandler) handler).onFirstRemoteVideoDecoded(uid, width, height, elapsed); } } + } - @Override - public void onFirstLocalVideoFrame(int width, int height, int elapsed) { - log.debug("onFirstLocalVideoFrame " + width + " " + height + " " + elapsed); - } + @Override + public void onFirstLocalVideoFrame(int width, int height, int elapsed) { + log.debug("onFirstLocalVideoFrame " + width + " " + height + " " + elapsed); + } - @Override - public void onUserJoined(int uid, int elapsed) { - log.debug("onUserJoined " + (uid & 0xFFFFFFFFL) + elapsed); + @Override + public void onUserJoined(int uid, int elapsed) { + log.debug("onUserJoined " + (uid & 0xFFFFFFFFL) + elapsed); - Iterator it = mEventHandlerList.keySet().iterator(); - while (it.hasNext()) { - AGEventHandler handler = it.next(); - if (handler instanceof DuringCallEventHandler) { - ((DuringCallEventHandler) handler).onUserJoined(uid); - } + Iterator it = mEventHandlerList.keySet().iterator(); + while (it.hasNext()) { + AGEventHandler handler = it.next(); + if (handler instanceof DuringCallEventHandler) { + ((DuringCallEventHandler) handler).onUserJoined(uid); } } + } + + @Override + public void onUserOffline(int uid, int reason) { + log.debug("onUserOffline " + (uid & 0xFFFFFFFFL) + " " + reason); - @Override - public void onUserOffline(int uid, int reason) { - log.debug("onUserOffline " + (uid & 0xFFFFFFFFL) + " " + reason); - - // FIXME this callback may return times - Iterator it = mEventHandlerList.keySet().iterator(); - while (it.hasNext()) { - AGEventHandler handler = it.next(); - if (handler instanceof DuringCallEventHandler) { - ((DuringCallEventHandler) handler).onUserOffline(uid, reason); - } + // FIXME this callback may return times + Iterator it = mEventHandlerList.keySet().iterator(); + while (it.hasNext()) { + AGEventHandler handler = it.next(); + if (handler instanceof DuringCallEventHandler) { + ((DuringCallEventHandler) handler).onUserOffline(uid, reason); } } + } - @Override - public void onUserMuteVideo(int uid, boolean muted) { - log.debug("onUserMuteVideo " + (uid & 0xFFFFFFFFL) + " " + muted); + @Override + public void onUserMuteVideo(int uid, boolean muted) { + log.debug("onUserMuteVideo " + (uid & 0xFFFFFFFFL) + " " + muted); - Iterator it = mEventHandlerList.keySet().iterator(); - while (it.hasNext()) { - AGEventHandler handler = it.next(); - if (handler instanceof DuringCallEventHandler) { - ((DuringCallEventHandler) handler).onExtraCallback(AGEventHandler.EVENT_TYPE_ON_USER_VIDEO_MUTED, uid, muted); - } + Iterator it = mEventHandlerList.keySet().iterator(); + while (it.hasNext()) { + AGEventHandler handler = it.next(); + if (handler instanceof DuringCallEventHandler) { + ((DuringCallEventHandler) handler).onExtraCallback(AGEventHandler.EVENT_TYPE_ON_USER_VIDEO_MUTED, uid, muted); } } + } - @Override - public void onRtcStats(RtcStats stats) { - } + @Override + public void onRtcStats(RtcStats stats) { + } - @Override - public void onRemoteVideoStats(RemoteVideoStats stats) { - log.debug("onRemoteVideoStats " + stats.uid + " " + stats.delay + " " + stats.receivedBitrate + " " + stats.rendererOutputFrameRate + " " + stats.width + " " + stats.height); + @Override + public void onRemoteVideoStats(RemoteVideoStats stats) { + log.debug("onRemoteVideoStats " + stats.uid + " " + stats.delay + " " + stats.receivedBitrate + " " + stats.rendererOutputFrameRate + " " + stats.width + " " + stats.height); - Iterator it = mEventHandlerList.keySet().iterator(); - while (it.hasNext()) { - AGEventHandler handler = it.next(); - if (handler instanceof DuringCallEventHandler) { - ((DuringCallEventHandler) handler).onExtraCallback(AGEventHandler.EVENT_TYPE_ON_USER_VIDEO_STATS, stats); - } + Iterator it = mEventHandlerList.keySet().iterator(); + while (it.hasNext()) { + AGEventHandler handler = it.next(); + if (handler instanceof DuringCallEventHandler) { + ((DuringCallEventHandler) handler).onExtraCallback(AGEventHandler.EVENT_TYPE_ON_USER_VIDEO_STATS, stats); } } + } - @Override - public void onAudioVolumeIndication(AudioVolumeInfo[] speakerInfos, int totalVolume) { - if (speakerInfos == null) { - // quick and dirty fix for crash - // TODO should reset UI for no sound - return; - } + @Override + public void onAudioVolumeIndication(AudioVolumeInfo[] speakerInfos, int totalVolume) { + if (speakerInfos == null) { + // quick and dirty fix for crash + // TODO should reset UI for no sound + return; + } - Iterator it = mEventHandlerList.keySet().iterator(); - while (it.hasNext()) { - AGEventHandler handler = it.next(); - if (handler instanceof DuringCallEventHandler) { - ((DuringCallEventHandler) handler).onExtraCallback(AGEventHandler.EVENT_TYPE_ON_SPEAKER_STATS, (Object) speakerInfos); - } + Iterator it = mEventHandlerList.keySet().iterator(); + while (it.hasNext()) { + AGEventHandler handler = it.next(); + if (handler instanceof DuringCallEventHandler) { + ((DuringCallEventHandler) handler).onExtraCallback(AGEventHandler.EVENT_TYPE_ON_SPEAKER_STATS, (Object) speakerInfos); } } + } - @Override - public void onLeaveChannel(RtcStats stats) { + @Override + public void onLeaveChannel(RtcStats stats) { - } + } - @Override - public void onLastmileQuality(int quality) { - log.debug("onLastmileQuality " + quality); - Iterator it = mEventHandlerList.keySet().iterator(); - while (it.hasNext()) { - AGEventHandler handler = it.next(); - if (handler instanceof BeforeCallEventHandler) { - ((BeforeCallEventHandler) handler).onLastmileQuality(quality); - } + @Override + public void onLastmileQuality(int quality) { + log.debug("onLastmileQuality " + quality); + Iterator it = mEventHandlerList.keySet().iterator(); + while (it.hasNext()) { + AGEventHandler handler = it.next(); + if (handler instanceof BeforeCallEventHandler) { + ((BeforeCallEventHandler) handler).onLastmileQuality(quality); } } + } - @Override - public void onLastmileProbeResult(IRtcEngineEventHandler.LastmileProbeResult result) { - log.debug("onLastmileProbeResult " + result); - Iterator it = mEventHandlerList.keySet().iterator(); - while (it.hasNext()) { - AGEventHandler handler = it.next(); - if (handler instanceof BeforeCallEventHandler) { - ((BeforeCallEventHandler) handler).onLastmileProbeResult(result); - } + @Override + public void onLastmileProbeResult(LastmileProbeResult result) { + log.debug("onLastmileProbeResult " + result); + Iterator it = mEventHandlerList.keySet().iterator(); + while (it.hasNext()) { + AGEventHandler handler = it.next(); + if (handler instanceof BeforeCallEventHandler) { + ((BeforeCallEventHandler) handler).onLastmileProbeResult(result); } } + } - @Override - public void onError(int error) { - log.debug("onError " + error + " " + RtcEngine.getErrorDescription(error)); + @Override + public void onError(int error) { + log.debug("onError " + error + " " + RtcEngine.getErrorDescription(error)); - Iterator it = mEventHandlerList.keySet().iterator(); - while (it.hasNext()) { - AGEventHandler handler = it.next(); - if (handler instanceof DuringCallEventHandler) { - ((DuringCallEventHandler) handler).onExtraCallback(AGEventHandler.EVENT_TYPE_ON_AGORA_MEDIA_ERROR, error, RtcEngine.getErrorDescription(error)); - } + Iterator it = mEventHandlerList.keySet().iterator(); + while (it.hasNext()) { + AGEventHandler handler = it.next(); + if (handler instanceof DuringCallEventHandler) { + ((DuringCallEventHandler) handler).onExtraCallback(AGEventHandler.EVENT_TYPE_ON_AGORA_MEDIA_ERROR, error, RtcEngine.getErrorDescription(error)); } } + } - @Override - public void onStreamMessage(int uid, int streamId, byte[] data) { - log.debug("onStreamMessage " + (uid & 0xFFFFFFFFL) + " " + streamId + " " + Arrays.toString(data)); + @Override + public void onStreamMessage(int uid, int streamId, byte[] data) { + log.debug("onStreamMessage " + (uid & 0xFFFFFFFFL) + " " + streamId + " " + Arrays.toString(data)); - Iterator it = mEventHandlerList.keySet().iterator(); - while (it.hasNext()) { - AGEventHandler handler = it.next(); - if (handler instanceof DuringCallEventHandler) { - ((DuringCallEventHandler) handler).onExtraCallback(AGEventHandler.EVENT_TYPE_ON_DATA_CHANNEL_MSG, uid, data); - } + Iterator it = mEventHandlerList.keySet().iterator(); + while (it.hasNext()) { + AGEventHandler handler = it.next(); + if (handler instanceof DuringCallEventHandler) { + ((DuringCallEventHandler) handler).onExtraCallback(AGEventHandler.EVENT_TYPE_ON_DATA_CHANNEL_MSG, uid, data); } } + } - public void onStreamMessageError(int uid, int streamId, int error, int missed, int cached) { - log.warn("onStreamMessageError " + (uid & 0xFFFFFFFFL) + " " + streamId + " " + error + " " + missed + " " + cached); + public void onStreamMessageError(int uid, int streamId, int error, int missed, int cached) { + log.warn("onStreamMessageError " + (uid & 0xFFFFFFFFL) + " " + streamId + " " + error + " " + missed + " " + cached); - Iterator it = mEventHandlerList.keySet().iterator(); - while (it.hasNext()) { - AGEventHandler handler = it.next(); - if (handler instanceof DuringCallEventHandler) { - ((DuringCallEventHandler) handler).onExtraCallback(AGEventHandler.EVENT_TYPE_ON_AGORA_MEDIA_ERROR, error, "on stream msg error " + (uid & 0xFFFFFFFFL) + " " + missed + " " + cached); - } + Iterator it = mEventHandlerList.keySet().iterator(); + while (it.hasNext()) { + AGEventHandler handler = it.next(); + if (handler instanceof DuringCallEventHandler) { + ((DuringCallEventHandler) handler).onExtraCallback(AGEventHandler.EVENT_TYPE_ON_AGORA_MEDIA_ERROR, error, "on stream msg error " + (uid & 0xFFFFFFFFL) + " " + missed + " " + cached); } } + } - @Override - public void onConnectionLost() { - log.debug("onConnectionLost"); + @Override + public void onConnectionLost() { + log.debug("onConnectionLost"); - Iterator it = mEventHandlerList.keySet().iterator(); - while (it.hasNext()) { - AGEventHandler handler = it.next(); - if (handler instanceof DuringCallEventHandler) { - ((DuringCallEventHandler) handler).onExtraCallback(AGEventHandler.EVENT_TYPE_ON_APP_ERROR, ConstantApp.AppError.NO_CONNECTION_ERROR); - } + Iterator it = mEventHandlerList.keySet().iterator(); + while (it.hasNext()) { + AGEventHandler handler = it.next(); + if (handler instanceof DuringCallEventHandler) { + ((DuringCallEventHandler) handler).onExtraCallback(AGEventHandler.EVENT_TYPE_ON_APP_ERROR, ConstantApp.AppError.NO_CONNECTION_ERROR); } } + } - @Override - public void onJoinChannelSuccess(String channel, int uid, int elapsed) { - log.debug("onJoinChannelSuccess " + channel + " " + (uid & 0xFFFFFFFFL) + "(" + uid + ") " + elapsed); - - mConfig.mUid = uid; + @Override + public void onJoinChannelSuccess(String channel, int uid, int elapsed) { + log.debug("onJoinChannelSuccess " + channel + " " + (uid & 0xFFFFFFFFL) + "(" + uid + ") " + elapsed); - Iterator it = mEventHandlerList.keySet().iterator(); - while (it.hasNext()) { - AGEventHandler handler = it.next(); - if (handler instanceof DuringCallEventHandler) { - ((DuringCallEventHandler) handler).onJoinChannelSuccess(channel, uid, elapsed); - } + Iterator it = mEventHandlerList.keySet().iterator(); + while (it.hasNext()) { + AGEventHandler handler = it.next(); + if (handler instanceof DuringCallEventHandler) { + ((DuringCallEventHandler) handler).onJoinChannelSuccess(channel, uid, elapsed); } } + } - public void onRejoinChannelSuccess(String channel, int uid, int elapsed) { - log.debug("onRejoinChannelSuccess " + channel + " " + uid + " " + elapsed); - } - - @Override - public void onAudioRouteChanged(int routing) { - log.debug("onAudioRouteChanged " + routing); + @Override + public void onAudioRouteChanged(int routing) { + log.debug("onAudioRouteChanged " + routing); - Iterator it = mEventHandlerList.keySet().iterator(); - while (it.hasNext()) { - AGEventHandler handler = it.next(); - if (handler instanceof DuringCallEventHandler) { - ((DuringCallEventHandler) handler).onExtraCallback(AGEventHandler.EVENT_TYPE_ON_AUDIO_ROUTE_CHANGED, routing); - } + Iterator it = mEventHandlerList.keySet().iterator(); + while (it.hasNext()) { + AGEventHandler handler = it.next(); + if (handler instanceof DuringCallEventHandler) { + ((DuringCallEventHandler) handler).onExtraCallback(AGEventHandler.EVENT_TYPE_ON_AUDIO_ROUTE_CHANGED, routing); } } + } - public void onWarning(int warn) { - log.debug("onWarning " + warn); - - String msg = "Check io.agora.rtc.Constants for details"; + public void onWarning(int warn) { + log.debug("onWarning " + warn); - Iterator it = mEventHandlerList.keySet().iterator(); - while (it.hasNext()) { - AGEventHandler handler = it.next(); - if (handler instanceof DuringCallEventHandler) { - ((DuringCallEventHandler) handler).onExtraCallback(AGEventHandler.EVENT_TYPE_ON_AGORA_MEDIA_ERROR, warn, msg); - } + String msg = "Check io.agora.rtc.Constants for details"; + Iterator it = mEventHandlerList.keySet().iterator(); + while (it.hasNext()) { + AGEventHandler handler = it.next(); + if (handler instanceof DuringCallEventHandler) { + ((DuringCallEventHandler) handler).onExtraCallback(AGEventHandler.EVENT_TYPE_ON_AGORA_MEDIA_ERROR, warn, msg); } } + } - @Override - public void onAudioMixingStateChanged(int state, int errorCode) { - log.debug("onAudioMixingStateChanged() state = [" + state + "], errorCode = [" + errorCode + "]"); - } - - @Override - public void onAudioMixingFinished() { - log.debug("onAudioMixingFinished"); - } - }; - + @Override + public void onAudioMixingStateChanged(int state, int errorCode) { + log.debug("onAudioMixingStateChanged() state = [" + state + "], errorCode = [" + errorCode + "]"); + } } diff --git a/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/model/WorkerThread.java b/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/model/WorkerThread.java deleted file mode 100644 index 32bdea6c..00000000 --- a/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/model/WorkerThread.java +++ /dev/null @@ -1,299 +0,0 @@ -package io.agora.openvcall.model; - -import android.content.Context; -import android.content.SharedPreferences; -import android.os.Handler; -import android.os.Looper; -import android.os.Message; -import android.preference.PreferenceManager; -import android.provider.Settings; -import android.text.TextUtils; -import android.util.Log; -import android.view.SurfaceView; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import io.agora.openvcall.R; -import io.agora.propeller.Constant; -import io.agora.rtc.Constants; -import io.agora.rtc.RtcEngine; -import io.agora.rtc.video.VideoCanvas; -import io.agora.rtc.video.VideoEncoderConfiguration; - -public class WorkerThread extends Thread { - private final static Logger log = LoggerFactory.getLogger(WorkerThread.class); - - private final Context mContext; - - private static final int ACTION_WORKER_THREAD_QUIT = 0X1010; // quit this thread - - private static final int ACTION_WORKER_JOIN_CHANNEL = 0X2010; - - private static final int ACTION_WORKER_LEAVE_CHANNEL = 0X2011; - - private static final int ACTION_WORKER_CONFIG_ENGINE = 0X2012; - - private static final int ACTION_WORKER_PREVIEW = 0X2014; - - private static final class WorkerThreadHandler extends Handler { - - private WorkerThread mWorkerThread; - - WorkerThreadHandler(WorkerThread thread) { - this.mWorkerThread = thread; - } - - public void release() { - mWorkerThread = null; - } - - @Override - public void handleMessage(Message msg) { - if (this.mWorkerThread == null) { - log.warn("handler is already released! " + msg.what); - return; - } - - switch (msg.what) { - case ACTION_WORKER_THREAD_QUIT: - mWorkerThread.exit(); - break; - case ACTION_WORKER_JOIN_CHANNEL: - String[] data = (String[]) msg.obj; - mWorkerThread.joinChannel(data[0], msg.arg1); - break; - case ACTION_WORKER_LEAVE_CHANNEL: - String channel = (String) msg.obj; - mWorkerThread.leaveChannel(channel); - break; - case ACTION_WORKER_CONFIG_ENGINE: - Object[] configData = (Object[]) msg.obj; - mWorkerThread.configEngine((VideoEncoderConfiguration.VideoDimensions) configData[0], (VideoEncoderConfiguration.FRAME_RATE) configData[1], (String) configData[2], (String) configData[3]); - break; - case ACTION_WORKER_PREVIEW: - Object[] previewData = (Object[]) msg.obj; - mWorkerThread.preview((boolean) previewData[0], (SurfaceView) previewData[1], (int) previewData[2]); - break; - } - } - } - - private WorkerThreadHandler mWorkerHandler; - - private boolean mReady; - - public final void waitForReady() { - while (!mReady) { - try { - Thread.sleep(20); - } catch (InterruptedException e) { - e.printStackTrace(); - } - log.debug("wait for " + WorkerThread.class.getSimpleName()); - } - } - - @Override - public void run() { - log.trace("start to run"); - Looper.prepare(); - - mWorkerHandler = new WorkerThreadHandler(this); - - ensureRtcEngineReadyLock(); - - mReady = true; - - // enter thread looper - Looper.loop(); - } - - private RtcEngine mRtcEngine; - - public final void enablePreProcessor() { - if (Constant.BEAUTY_EFFECT_ENABLED) { - mRtcEngine.setBeautyEffectOptions(true, Constant.BEAUTY_OPTIONS); - } - } - - public final void setBeautyEffectParameters(float lightness, float smoothness, float redness) { - Constant.BEAUTY_OPTIONS.lighteningLevel = lightness; - Constant.BEAUTY_OPTIONS.smoothnessLevel = smoothness; - Constant.BEAUTY_OPTIONS.rednessLevel = redness; - } - - public final void disablePreProcessor() { - // do not support null when setBeautyEffectOptions to false - mRtcEngine.setBeautyEffectOptions(false, Constant.BEAUTY_OPTIONS); - } - - public final void joinChannel(final String channel, int uid) { - if (Thread.currentThread() != this) { - log.warn("joinChannel() - worker thread asynchronously " + channel + " " + uid); - Message envelop = new Message(); - envelop.what = ACTION_WORKER_JOIN_CHANNEL; - envelop.obj = new String[]{channel}; - envelop.arg1 = uid; - mWorkerHandler.sendMessage(envelop); - return; - } - - ensureRtcEngineReadyLock(); - - String accessToken = mContext.getString(R.string.agora_access_token); - if (TextUtils.equals(accessToken, "") || TextUtils.equals(accessToken, "#YOUR ACCESS TOKEN#")) { - accessToken = null; // default, no token - } - - mRtcEngine.joinChannel(accessToken, channel, "OpenVCall", uid); - - mEngineConfig.mChannel = channel; - - enablePreProcessor(); - log.debug("joinChannel " + channel + " " + uid); - } - - public final void leaveChannel(String channel) { - if (Thread.currentThread() != this) { - log.warn("leaveChannel() - worker thread asynchronously " + channel); - Message envelop = new Message(); - envelop.what = ACTION_WORKER_LEAVE_CHANNEL; - envelop.obj = channel; - mWorkerHandler.sendMessage(envelop); - return; - } - - if (mRtcEngine != null) { - mRtcEngine.leaveChannel(); - mRtcEngine.enableVideo(); - } - - disablePreProcessor(); - - mEngineConfig.reset(); - log.debug("leaveChannel " + channel); - } - - private EngineConfig mEngineConfig; - - public final EngineConfig getEngineConfig() { - return mEngineConfig; - } - - private final MyEngineEventHandler mEngineEventHandler; - - public final void configEngine(VideoEncoderConfiguration.VideoDimensions videoDimension, VideoEncoderConfiguration.FRAME_RATE fps, String encryptionKey, String encryptionMode) { - if (Thread.currentThread() != this) { - log.warn("configEngine() - worker thread asynchronously " + videoDimension + " " + fps + " " + encryptionMode); - Message envelop = new Message(); - envelop.what = ACTION_WORKER_CONFIG_ENGINE; - envelop.obj = new Object[]{videoDimension, fps, encryptionKey, encryptionMode}; - mWorkerHandler.sendMessage(envelop); - return; - } - - ensureRtcEngineReadyLock(); - - if (!TextUtils.isEmpty(encryptionKey)) { - mRtcEngine.setEncryptionMode(encryptionMode); - - mRtcEngine.setEncryptionSecret(encryptionKey); - } - - // mRtcEngine.setVideoProfile(mEngineConfig.mVideoProfile, false); // for sdk earlier than 2.3.0 - mRtcEngine.setVideoEncoderConfiguration(new VideoEncoderConfiguration(videoDimension, - fps, - VideoEncoderConfiguration.STANDARD_BITRATE, - VideoEncoderConfiguration.ORIENTATION_MODE.ORIENTATION_MODE_FIXED_PORTRAIT)); - - log.debug("configEngine " + videoDimension + " " + fps + " " + encryptionMode); - } - - public final void preview(boolean start, SurfaceView view, int uid) { - if (Thread.currentThread() != this) { - log.warn("preview() - worker thread asynchronously " + start + " " + view + " " + (uid & 0XFFFFFFFFL)); - Message envelop = new Message(); - envelop.what = ACTION_WORKER_PREVIEW; - envelop.obj = new Object[]{start, view, uid}; - mWorkerHandler.sendMessage(envelop); - return; - } - - ensureRtcEngineReadyLock(); - if (start) { - mRtcEngine.setupLocalVideo(new VideoCanvas(view, VideoCanvas.RENDER_MODE_HIDDEN, uid)); - mRtcEngine.startPreview(); - } else { - mRtcEngine.stopPreview(); - } - } - - public static String getDeviceID(Context context) { - // XXX according to the API docs, this value may change after factory reset - // use Android id as device id - return Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID); - } - - private RtcEngine ensureRtcEngineReadyLock() { - if (mRtcEngine == null) { - String appId = mContext.getString(R.string.agora_app_id); - if (TextUtils.isEmpty(appId)) { - throw new RuntimeException("NEED TO use your App ID, get your own ID at https://dashboard.agora.io/"); - } - try { - mRtcEngine = RtcEngine.create(mContext, appId, mEngineEventHandler.mRtcEventHandler); - } catch (Exception e) { - log.error(Log.getStackTraceString(e)); - throw new RuntimeException("NEED TO check rtc sdk init fatal error\n" + Log.getStackTraceString(e)); - } - mRtcEngine.setChannelProfile(Constants.CHANNEL_PROFILE_COMMUNICATION); - mRtcEngine.enableVideo(); - mRtcEngine.enableAudioVolumeIndication(200, 3); // 200 ms - } - return mRtcEngine; - } - - public MyEngineEventHandler eventHandler() { - return mEngineEventHandler; - } - - public RtcEngine getRtcEngine() { - return mRtcEngine; - } - - /** - * call this method to exit - * should ONLY call this method when this thread is running - */ - public final void exit() { - if (Thread.currentThread() != this) { - log.warn("exit() - exit app thread asynchronously"); - mWorkerHandler.sendEmptyMessage(ACTION_WORKER_THREAD_QUIT); - return; - } - - mReady = false; - - // TODO should remove all pending(read) messages - - log.debug("exit() > start"); - - // exit thread looper - Looper.myLooper().quit(); - - mWorkerHandler.release(); - - log.debug("exit() > end"); - } - - public WorkerThread(Context context) { - this.mContext = context; - - this.mEngineConfig = new EngineConfig(); - SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context); - this.mEngineConfig.mUid = pref.getInt(ConstantApp.PrefManager.PREF_PROPERTY_UID, 0); - - this.mEngineEventHandler = new MyEngineEventHandler(mContext, this.mEngineConfig); - } -} diff --git a/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/ui/BaseActivity.java b/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/ui/BaseActivity.java index 8aefabf5..6f727989 100644 --- a/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/ui/BaseActivity.java +++ b/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/ui/BaseActivity.java @@ -6,21 +6,23 @@ import android.os.Build; import android.os.Bundle; import android.os.Handler; -import android.os.Looper; import android.support.annotation.NonNull; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; import android.support.v7.app.AppCompatActivity; +import android.text.TextUtils; import android.util.DisplayMetrics; import android.view.*; import android.view.inputmethod.InputMethodManager; -import android.widget.EditText; import android.widget.Toast; import io.agora.openvcall.AGApplication; -import io.agora.openvcall.BuildConfig; +import io.agora.openvcall.R; import io.agora.openvcall.model.*; import io.agora.propeller.Constant; import io.agora.rtc.RtcEngine; +import io.agora.rtc.video.VideoCanvas; +import io.agora.rtc.video.VideoEncoderConfiguration; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -52,7 +54,7 @@ public void onGlobalLayout() { protected abstract void deInitUIandEvent(); - protected void workerThreadReady() { + protected void permissionGranted() { } @Override @@ -93,26 +95,6 @@ public final void closeIME(View v) { v.clearFocus(); } - public final void closeIMEWithoutFocus(View v) { - InputMethodManager mgr = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE); - mgr.hideSoftInputFromWindow(v.getWindowToken(), 0); // 0 force close IME - } - - public void openIME(final EditText v) { - final boolean focus = v.requestFocus(); - if (v.hasFocus()) { - final Handler handler = new Handler(Looper.getMainLooper()); - handler.post(new Runnable() { - @Override - public void run() { - InputMethodManager mgr = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE); - boolean result = mgr.showSoftInput(v, InputMethodManager.SHOW_FORCED); - log.debug("openIME " + focus + " " + result); - } - }); - } - } - public boolean checkSelfPermission(String permission, int requestCode) { log.debug("checkSelfPermission " + permission + " " + requestCode); if (ContextCompat.checkSelfPermission(this, @@ -126,26 +108,33 @@ public boolean checkSelfPermission(String permission, int requestCode) { } if (Manifest.permission.CAMERA.equals(permission)) { - ((AGApplication) getApplication()).initWorkerThread(); - workerThreadReady(); + permissionGranted(); } return true; } + protected AGApplication application() { + return (AGApplication) getApplication(); + } + protected RtcEngine rtcEngine() { - return ((AGApplication) getApplication()).getWorkerThread().getRtcEngine(); + return application().rtcEngine(); } - protected final WorkerThread worker() { - return ((AGApplication) getApplication()).getWorkerThread(); + protected EngineConfig config() { + return application().config(); } - protected final EngineConfig config() { - return ((AGApplication) getApplication()).getWorkerThread().getEngineConfig(); + protected void addEventHandler(AGEventHandler handler) { + application().addEventHandler(handler); } - protected final MyEngineEventHandler event() { - return ((AGApplication) getApplication()).getWorkerThread().eventHandler(); + protected void removeEventHandler(AGEventHandler handler) { + application().remoteEventHandler(handler); + } + + protected CurrentUserSettings vSettings() { + return application().userSettings(); } public final void showLongToast(final String msg) { @@ -175,8 +164,7 @@ public void onRequestPermissionsResult(int requestCode, if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE, ConstantApp.PERMISSION_REQ_ID_WRITE_EXTERNAL_STORAGE); - ((AGApplication) getApplication()).initWorkerThread(); - workerThreadReady(); + permissionGranted(); } else { finish(); } @@ -193,10 +181,6 @@ public void onRequestPermissionsResult(int requestCode, } } - protected CurrentUserSettings vSettings() { - return AGApplication.mVideoSettings; - } - protected int virtualKeyHeight() { boolean hasPermanentMenuKey = ViewConfiguration.get(getApplication()).hasPermanentMenuKey(); if (hasPermanentMenuKey) { @@ -275,10 +259,62 @@ protected final int getActionBarHeight() { return actionBarHeight; } - protected void initVersionInfo() { - String version = "V " + BuildConfig.VERSION_NAME + "(Build: " + BuildConfig.VERSION_CODE - + ", " + ConstantApp.APP_BUILD_DATE + ", SDK: " + Constant.MEDIA_SDK_VERSION + ")"; -// TextView textVersion = (TextView) findViewById(R.id.app_version); -// textVersion.setText(version); + protected void preview(boolean start, SurfaceView view, int uid) { + if (start) { + rtcEngine().setupLocalVideo(new VideoCanvas(view, VideoCanvas.RENDER_MODE_HIDDEN, uid)); + rtcEngine().startPreview(); + } else { + rtcEngine().stopPreview(); + } + } + + public final void joinChannel(final String channel, int uid) { + String accessToken = getApplicationContext().getString(R.string.agora_access_token); + if (TextUtils.equals(accessToken, "") || TextUtils.equals(accessToken, "<#YOUR ACCESS TOKEN#>")) { + accessToken = null; // default, no token + } + + rtcEngine().joinChannel(accessToken, channel, "OpenVCall", uid); + config().mChannel = channel; + enablePreProcessor(); + log.debug("joinChannel " + channel + " " + uid); + } + + public final void leaveChannel(String channel) { + log.debug("leaveChannel " + channel); + config().mChannel = null; + disablePreProcessor(); + rtcEngine().leaveChannel(); + config().reset(); + } + + protected void enablePreProcessor() { + if (Constant.BEAUTY_EFFECT_ENABLED) { + rtcEngine().setBeautyEffectOptions(true, Constant.BEAUTY_OPTIONS); + } + } + + public final void setBeautyEffectParameters(float lightness, float smoothness, float redness) { + Constant.BEAUTY_OPTIONS.lighteningLevel = lightness; + Constant.BEAUTY_OPTIONS.smoothnessLevel = smoothness; + Constant.BEAUTY_OPTIONS.rednessLevel = redness; + } + + protected void disablePreProcessor() { + // do not support null when setBeautyEffectOptions to false + rtcEngine().setBeautyEffectOptions(false, Constant.BEAUTY_OPTIONS); + } + + protected void configEngine(VideoEncoderConfiguration.VideoDimensions videoDimension, VideoEncoderConfiguration.FRAME_RATE fps, String encryptionKey, String encryptionMode) { + if (!TextUtils.isEmpty(encryptionKey)) { + rtcEngine().setEncryptionMode(encryptionMode); + rtcEngine().setEncryptionSecret(encryptionKey); + } + + log.debug("configEngine " + videoDimension + " " + fps + " " + encryptionMode); + rtcEngine().setVideoEncoderConfiguration(new VideoEncoderConfiguration(videoDimension, + fps, + VideoEncoderConfiguration.STANDARD_BITRATE, + VideoEncoderConfiguration.ORIENTATION_MODE.ORIENTATION_MODE_FIXED_PORTRAIT)); } } diff --git a/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/ui/CallActivity.java b/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/ui/CallActivity.java index 4fd4b904..82db84a7 100644 --- a/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/ui/CallActivity.java +++ b/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/ui/CallActivity.java @@ -117,13 +117,9 @@ public boolean onOptionsItemSelected(MenuItem item) { @Override protected void initUIandEvent() { - event().addEventHandler(this); + addEventHandler(this); + String channelName = getIntent().getStringExtra(ConstantApp.ACTION_KEY_CHANNEL_NAME); - Intent i = getIntent(); - - String channelName = i.getStringExtra(ConstantApp.ACTION_KEY_CHANNEL_NAME); - - // programmatically show channel name ActionBar ab = getSupportActionBar(); if (ab != null) { TextView channelNameView = ((TextView) findViewById(R.id.ovc_page_title)); @@ -142,7 +138,6 @@ protected void initUIandEvent() { mGridVideoViewContainer = (GridVideoViewContainer) findViewById(R.id.grid_video_view_container); mGridVideoViewContainer.setItemEventHandler(new RecyclerItemClickListener.OnItemClickListener() { - @Override public void onItemClick(View view, int position) { onBigVideoViewClicked(view, position); @@ -150,6 +145,7 @@ public void onItemClick(View view, int position) { @Override public void onItemLongClick(View view, int position) { + } @Override @@ -159,27 +155,24 @@ public void onItemDoubleClick(View view, int position) { }); SurfaceView surfaceV = RtcEngine.CreateRendererView(getApplicationContext()); - rtcEngine().setupLocalVideo(new VideoCanvas(surfaceV, VideoCanvas.RENDER_MODE_HIDDEN, 0)); + preview(true, surfaceV, 0); surfaceV.setZOrderOnTop(false); surfaceV.setZOrderMediaOverlay(false); mUidsList.put(0, surfaceV); // get first surface view mGridVideoViewContainer.initViewContainer(this, 0, mUidsList, mIsLandscape); // first is now full view - worker().preview(true, surfaceV, 0); initMessageList(); - notifyMessageChanged(new Message(new User(0, null), "start join " + channelName + " as " + (config().mUid & 0xFFFFFFFFL))); - worker().joinChannel(channelName, config().mUid); + joinChannel(channelName, config().mUid); optional(); } private void onBigVideoViewClicked(View view, int position) { log.debug("onItemClick " + view + " " + position + " " + mLayoutType); - toggleFullscreen(); } @@ -314,7 +307,6 @@ public void onClickHideIME(View view) { log.debug("onClickHideIME " + view); closeIME(findViewById(R.id.msg_content)); - findViewById(R.id.msg_input_container).setVisibility(View.GONE); findViewById(R.id.bottom_action_container).setVisibility(View.VISIBLE); } @@ -332,9 +324,7 @@ private void initMessageList() { private void notifyMessageChanged(Message msg) { mMsgList.add(msg); - int MAX_MESSAGE_COUNT = 16; - if (mMsgList.size() > MAX_MESSAGE_COUNT) { int toRemove = mMsgList.size() - MAX_MESSAGE_COUNT; for (int i = 0; i < toRemove; i++) { @@ -383,8 +373,7 @@ private int getVideoEncFpsIndex() { private void doConfigEngine(String encryptionKey, String encryptionMode) { VideoEncoderConfiguration.VideoDimensions videoDimension = ConstantApp.VIDEO_DIMENSIONS[getVideoEncResolutionIndex()]; VideoEncoderConfiguration.FRAME_RATE videoFps = ConstantApp.VIDEO_FPS[getVideoEncFpsIndex()]; - - worker().configEngine(videoDimension, videoFps, encryptionKey, encryptionMode); + configEngine(videoDimension, videoFps, encryptionKey, encryptionMode); } public void onSwitchCameraClicked(View view) { @@ -401,10 +390,10 @@ public void onFilterClicked(View view) { Constant.BEAUTY_EFFECT_ENABLED = !Constant.BEAUTY_EFFECT_ENABLED; if (Constant.BEAUTY_EFFECT_ENABLED) { - worker().setBeautyEffectParameters(Constant.BEAUTY_EFFECT_DEFAULT_LIGHTNESS, Constant.BEAUTY_EFFECT_DEFAULT_SMOOTHNESS, Constant.BEAUTY_EFFECT_DEFAULT_REDNESS); - worker().enablePreProcessor(); + setBeautyEffectParameters(Constant.BEAUTY_EFFECT_DEFAULT_LIGHTNESS, Constant.BEAUTY_EFFECT_DEFAULT_SMOOTHNESS, Constant.BEAUTY_EFFECT_DEFAULT_REDNESS); + enablePreProcessor(); } else { - worker().disablePreProcessor(); + disablePreProcessor(); } ImageView iv = (ImageView) view; @@ -415,16 +404,14 @@ public void onFilterClicked(View view) { @Override protected void deInitUIandEvent() { optionalDestroy(); - doLeaveChannel(); - event().removeEventHandler(this); - + removeEventHandler(this); mUidsList.clear(); } private void doLeaveChannel() { - worker().leaveChannel(config().mChannel); - worker().preview(false, null, 0); + leaveChannel(config().mChannel); + preview(false, null, 0); } public void onHangupClicked(View view) { @@ -585,37 +572,16 @@ public void run() { @Override public void onJoinChannelSuccess(String channel, final int uid, int elapsed) { log.debug("onJoinChannelSuccess " + channel + " " + (uid & 0xFFFFFFFFL) + " " + elapsed); - - runOnUiThread(new Runnable() { - @Override - public void run() { - if (isFinishing()) { - return; - } - - notifyMessageChanged(new Message(new User(0, null), "join " + channel + " success as " + (uid & 0xFFFFFFFFL) + " in " + elapsed + "ms")); - - SurfaceView local = mUidsList.remove(0); - - if (local == null) { - return; - } - - mUidsList.put(uid, local); - } - }); } @Override public void onUserOffline(int uid, int reason) { log.debug("onUserOffline " + (uid & 0xFFFFFFFFL) + " " + reason); - doRemoveRemoteUi(uid); } @Override public void onExtraCallback(final int type, final Object... data) { - runOnUiThread(new Runnable() { @Override public void run() { diff --git a/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/ui/MainActivity.java b/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/ui/MainActivity.java index 06dc9a31..bc4a3cf6 100644 --- a/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/ui/MainActivity.java +++ b/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/ui/MainActivity.java @@ -146,7 +146,7 @@ public void onClickDoNetworkTest(View view) { } @Override - public void workerThreadReady() { + public void permissionGranted() { } diff --git a/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/ui/NetworkTestActivity.java b/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/ui/NetworkTestActivity.java index 5022e23f..73ccce04 100644 --- a/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/ui/NetworkTestActivity.java +++ b/Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/ui/NetworkTestActivity.java @@ -34,7 +34,7 @@ protected void onCreate(Bundle savedInstanceState) { @Override protected void initUIandEvent() { - event().addEventHandler(this); + addEventHandler(this); ((TextView) findViewById(R.id.ovc_page_title)).setText(R.string.label_network_testing); @@ -49,7 +49,7 @@ protected void initUIandEvent() { @Override protected void deInitUIandEvent() { rtcEngine().stopLastmileProbeTest(); - event().removeEventHandler(this); + removeEventHandler(this); } @Override diff --git a/Group-Video/OpenVideoCall-Android/app/src/main/res/values/strings_config.xml b/Group-Video/OpenVideoCall-Android/app/src/main/res/values/strings_config.xml index 639101d5..f9dc6680 100644 --- a/Group-Video/OpenVideoCall-Android/app/src/main/res/values/strings_config.xml +++ b/Group-Video/OpenVideoCall-Android/app/src/main/res/values/strings_config.xml @@ -9,7 +9,7 @@ <#YOUR APP ID#> - #YOUR ACCESS TOKEN# + <#YOUR ACCESS TOKEN#> AES-128-XTS diff --git a/Group-Video/OpenVideoCall-Android/ci.env.py b/Group-Video/OpenVideoCall-Android/ci.env.py index dfc7dbac..6a5d0528 100644 --- a/Group-Video/OpenVideoCall-Android/ci.env.py +++ b/Group-Video/OpenVideoCall-Android/ci.env.py @@ -5,13 +5,13 @@ def main(): - f = open("./app/build.gradle", 'r+') - content = f.read() - x = re.sub( - r'(dependencies {$)(.*)', r"\1\n implementation 'io.agora.rtc:full-sdk:2.4.1'\2", content, flags=re.M) - f.seek(0) - f.write(x) - f.truncate() +# f = open("./app/build.gradle", 'r+') +# content = f.read() +# x = re.sub( +# r'(dependencies {$)(.*)', r"\1\n implementation 'io.agora.rtc:full-sdk:2.4.1'\2", content, flags=re.M) +# f.seek(0) +# f.write(x) +# f.truncate() appId = "" if "AGORA_APP_ID" in os.environ: @@ -21,7 +21,7 @@ def main(): f = open("./app/src/main/res/values/strings_config.xml", 'r+') content = f.read() contentNew = re.sub(r'<#YOUR APP ID#>', appId, content) - contentNew = re.sub(r'#YOUR ACCESS TOKEN#', token, contentNew) + contentNew = re.sub(r'<#YOUR ACCESS TOKEN#>', token, contentNew) f.seek(0) f.write(contentNew) f.truncate() diff --git a/Group-Video/OpenVideoCall-Web/README.md b/Group-Video/OpenVideoCall-Web/README.md index fd6d8848..3f404789 100755 --- a/Group-Video/OpenVideoCall-Web/README.md +++ b/Group-Video/OpenVideoCall-Web/README.md @@ -25,10 +25,10 @@ To build and run the sample application, get an App ID: **Note:** Place the App ID/Token within single or double quotes. - ```javascript - export const APP_ID = "<#YOUR APP ID HERE#>"; + ```xml + export const APP_ID = <#YOUR APP ID#>; - // If you have not enabled app certificate, make sure to set the Token to null + // Assign Token to null if you have not enabled app certificate export const Token = "<#YOUR TEMP TOKEN HERE#>"; ``` @@ -57,8 +57,13 @@ To build and run the sample application, get an App ID: ## Resources -- You can find full API document at [Document Center](https://docs.agora.io/en/) -- You can file bugs about this demo at [issue](https://github.com/AgoraIO/Basic-Video-Call/issues) +- For potential issues, take a look at our [FAQ](https://docs.agora.io/cn/faq) first +- Dive into [Agora SDK Samples](https://github.com/AgoraIO) to see more tutorials +- Take a look at [Agora Use Case](https://github.com/AgoraIO-usecase) for more complicated real use case +- Repositories managed by developer communities can be found at [Agora Community](https://github.com/AgoraIO-Community) +- You can find full API documentation at [Document Center](https://docs.agora.io/en/) +- If you encounter problems during integration, you can ask question in [Stack Overflow](https://stackoverflow.com/questions/tagged/agora.io) +- You can file bugs about this sample at [issue](https://github.com/AgoraIO/Basic-Video-Call/issues) ## License diff --git a/Group-Video/OpenVideoCall-Web/README.yaml b/Group-Video/OpenVideoCall-Web/README.yaml deleted file mode 100644 index 83f24c8a..00000000 --- a/Group-Video/OpenVideoCall-Web/README.yaml +++ /dev/null @@ -1,40 +0,0 @@ -Meta: - name: Open Video Call for Web - # en or cn - lang: en - # | 代表这里是字符串 - description: | - This tutorial shows you how to quickly create an open video call using the Agora sample app. - -Prerequisites: - - Node.js 6.9.1+ - - A web server that supports SSL (https) - -QuickStart: - description: - This section shows you how to prepare, build, and run the sample application. - sections: - - title: Obtain an App ID - content: | - $_{APPID} - 5. Open the **src/utils/Settings.js** file. At the bottom of the file, replace `<#YOUR APP ID#>` with the App ID, and assign the token variable with the temp Access Token generated from dashboard. - - **Note:** Place the App ID/Token within single or double quotes. - - ```xml - export const APP_ID = <#YOUR APP ID#>; - - // Assign Token to null if you have not enabled app certificate - export const Token = "<#YOUR TEMP TOKEN HERE#>"; - ``` - - title: Install dependencies and integrate the Agora Video SDK - content: | - - $_{WEB_RUN} - -Resources: - document: https://docs.agora.io/en/ - issue: https://github.com/AgoraIO/Basic-Video-Call/issues - -License: - type: MIT \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Web/README.zh.md b/Group-Video/OpenVideoCall-Web/README.zh.md index 3d3cda0c..d4f1bf97 100644 --- a/Group-Video/OpenVideoCall-Web/README.zh.md +++ b/Group-Video/OpenVideoCall-Web/README.zh.md @@ -47,11 +47,13 @@ ## 联系我们 +- 如果你遇到了困难,可以先参阅[常见问题](https://docs.agora.io/cn/faq) +- 如果你想了解更多官方示例,可以参考[官方SDK示例](https://github.com/AgoraIO) +- 如果你想了解声网SDK在复杂场景下的应用,可以参考[官方场景案例](https://github.com/AgoraIO-usecase) +- 如果你想了解声网的一些社区开发者维护的项目,可以查看[社区](https://github.com/AgoraIO-Community) - 完整的 API 文档见 [文档中心](https://docs.agora.io/cn/) -- 如果在集成中遇到问题, 你可以到 [开发者社区](https://dev.agora.io/cn/) 提问 -- 如果有售前咨询问题, 可以拨打 400 632 6626,或加入官方Q群 12742516 提问 -- 如果需要售后技术支持, 你可以在 [Agora Dashboard](https://dashboard.agora.io) 提交工单 -- 如果发现了示例代码的 bug, 欢迎提交 [issue](https://github.com/AgoraIO/Basic-Video-Call/issues) +- 若遇到问题需要开发者帮助,你可以到 [开发者社区](https://rtcdeveloper.com/) 提问 +- 如果发现了示例代码的 bug,欢迎提交 [issue](https://github.com/AgoraIO/Basic-Video-Call/issues) ## 代码许可 diff --git a/Group-Video/OpenVideoCall-Web/README.zh.yaml b/Group-Video/OpenVideoCall-Web/README.zh.yaml deleted file mode 100644 index d68118a0..00000000 --- a/Group-Video/OpenVideoCall-Web/README.zh.yaml +++ /dev/null @@ -1,38 +0,0 @@ -Meta: - name: Open Video Call for Web - # en or cn - lang: cn - # | 代表这里是字符串 - description: | - 这个开源示例项目演示了如何快速集成 Agora 视频 SDK,实现多人视频通话。 - -Prerequisites: - - Node.js 6.9.1+ - - 支持SSL(https)的服务器 - -QuickStart: - description: - 这个段落主要讲解了如何编译和运行示例程序。 - sections: - - title: 创建Agora账号并获取AppId - content: | - $_{APPID} - 5. 打开 **src/utils/Settings.js** 文件。在文件的底部,将`<#YOUR APP ID#>`替换为您自己的App ID,然后将`<#YOUR TEMP TOKEN#>`替换为dashboard计算的Token。 - - **注意:** App ID是字符串类型,需要双引号或者单引号 - ```javascript - export const APP_ID = <#YOUR APP ID#>; - - // 如果你没有打开Token功能,token可以直接给null - export const Token = "<#YOUR TEMP TOKEN HERE#>"; - ``` - - title: 集成 Agora 视频 SDK - content: | - $_{WEB_RUN} - -Resources: - document: https://docs.agora.io/cn/ - issue: https://github.com/AgoraIO/Basic-Video-Call/issues - -License: - type: MIT \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/.gitignore b/Group-Video/OpenVideoCall-Windows/.gitignore new file mode 100644 index 00000000..11892919 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/.gitignore @@ -0,0 +1,12 @@ +Win32/ +sdk/ +debug/ +release/ +*.sdf +*.opensdf +*.suo +*.vcxproj +*.vcxproj.filters +*.vcxproj.user +*.ini +ui_* diff --git a/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/ChineseSimplified.cpp b/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/ChineseSimplified.cpp deleted file mode 100644 index 78da8e07..00000000 --- a/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/ChineseSimplified.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// ChineseSimplified.cpp : DLL Ӧóĵ -// - -#include "stdafx.h" -#include "ChineseSimplified.h" - - -// ǵһʾ -CHINESESIMPLIFIED_API LPCTSTR IDS_TITLE = _T("Open Video Call"); -CHINESESIMPLIFIED_API LPCTSTR IDS_LOGO_DESC = _T("AgoraƵͨ ʵʱ ı"); -CHINESESIMPLIFIED_API LPCTSTR IDS_LOGO_AGORAWEB = _T("agora.io"); - -CHINESESIMPLIFIED_API LPCTSTR IDS_CONTACT = _T("ֵ֧绰: "); -CHINESESIMPLIFIED_API LPCTSTR IDS_PHONENUMBER = _T("400 632 6626"); - -CHINESESIMPLIFIED_API LPCTSTR IDS_PRE_TITLE = _T("Slelct conference type"); -CHINESESIMPLIFIED_API LPCTSTR IDS_PRE_OPTDSC1 = _T("* Optimized calls have best performance but"); -CHINESESIMPLIFIED_API LPCTSTR IDS_PRE_OPTDSC2 = _T(" cannot be joined by web participants"); -CHINESESIMPLIFIED_API LPCTSTR IDS_PRE_WEBDSC1 = _T("* Web-compatible calls have goog performance"); -CHINESESIMPLIFIED_API LPCTSTR IDS_PRE_WEBDSC2 = _T(" and open to web participants"); -CHINESESIMPLIFIED_API LPCTSTR IDS_PRE_BTNOPT = _T("Optimized"); -CHINESESIMPLIFIED_API LPCTSTR IDS_PRE_BTNWEB = _T("Web-compatible"); - -CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_TITLE = _T(""); -CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_DSC1 = _T("ûƲ, 㽫Զ뵽û; ûҴ, 㽫"); -CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_DSC2 = _T("ԶýеĻ"); -// CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_DSC3 = _T(""); -// CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_DSC4 = _T("progress"); - -CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_BTBACK = _T(""); -CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_BTTEST = _T("豸"); -CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_BTJOIN = _T(""); - -CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_CHTIP = _T("Ƶ"); -CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_KEYTIP = _T("Կ"); - -CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_ENCTYPE = _T("EncType:"); -CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_AES128XTS = _T("aes-128"); -CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_AES128GCM = _T("aes-128-gcm"); -CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_AES128CCM = _T("aes-128-ccm"); -CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_AES128CTR = _T("aes-128-ctr"); -CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_AES256XTS = _T("aes-256"); -CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_AES256GCM = _T("aes-256-gcm"); -CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_AES256CCM = _T("aes-256-ccm"); -CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_AES256CTR = _T("aes-256-ctr"); - -CHINESESIMPLIFIED_API LPCTSTR IDS_SET_RESOLUTION = _T("ֱ"); -CHINESESIMPLIFIED_API LPCTSTR IDS_SET_MFR = _T("֡"); -CHINESESIMPLIFIED_API LPCTSTR IDS_SET_MR = _T(""); -CHINESESIMPLIFIED_API LPCTSTR IDS_SET_BTCONFIRM = _T("ȷ"); - -CHINESESIMPLIFIED_API LPCTSTR IDS_SET_CODEC = _T(""); -CHINESESIMPLIFIED_API LPCTSTR IDS_SET_SWAPWH = _T("߱Ȼ"); -CHINESESIMPLIFIED_API LPCTSTR IDS_SET_SAVESETTING = _T("浱ǰ"); - -CHINESESIMPLIFIED_API LPCTSTR IDS_DEVICE_AUDIOIN = _T("Ƶ:"); -CHINESESIMPLIFIED_API LPCTSTR IDS_DEVICE_AUDIOOUT = _T("Ƶ:"); -CHINESESIMPLIFIED_API LPCTSTR IDS_DEVICE_CAMERA = _T("ͷ:"); -CHINESESIMPLIFIED_API LPCTSTR IDS_DEVICE_VOLUME = _T(""); -CHINESESIMPLIFIED_API LPCTSTR IDS_DEVICE_BTNTEST = _T(""); -CHINESESIMPLIFIED_API LPCTSTR IDS_DEVICE_BTNTESTOFF = _T("ֹͣ"); -CHINESESIMPLIFIED_API LPCTSTR IDS_DEVICE_CANCEL = _T("ȡ"); -CHINESESIMPLIFIED_API LPCTSTR IDS_DEVICE_CONFIRM = _T("ȷ"); - -CHINESESIMPLIFIED_API LPCTSTR IDS_VIDEO_SCRSHARE = _T("Ļ"); -CHINESESIMPLIFIED_API LPCTSTR IDS_VIDEO_WNDSHARE = _T("ڹ"); - -CHINESESIMPLIFIED_API LPCTSTR IDS_VIDEO_WBHOST = _T("ģʽ"); -CHINESESIMPLIFIED_API LPCTSTR IDS_VIDEO_WBGUEST = _T("ģʽ"); - -CHINESESIMPLIFIED_API LPCTSTR IDS_VIDEO_MOREINFO = _T("ƵϢ"); -CHINESESIMPLIFIED_API LPCTSTR IDS_VIDEO_MOREDEVICE = _T("豸"); -CHINESESIMPLIFIED_API LPCTSTR IDS_VIDEO_MOREFILTER = _T("˾"); \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/ChineseSimplified.h b/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/ChineseSimplified.h deleted file mode 100644 index 811549e9..00000000 --- a/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/ChineseSimplified.h +++ /dev/null @@ -1,80 +0,0 @@ -// ifdef Ǵʹ DLL 򵥵 -// ı׼ DLL еļ϶ CHINESESIMPLIFIED_EXPORTS -// űġʹô DLL -// κĿϲӦ˷šԴļаļκĿὫ -// CHINESESIMPLIFIED_API ΪǴ DLL ģ DLL ô˺궨 -// ΪDZġ -#ifdef CHINESESIMPLIFIED_EXPORTS -#define CHINESESIMPLIFIED_API __declspec(dllexport) -#else -#define CHINESESIMPLIFIED_API __declspec(dllimport) -#endif - -extern CHINESESIMPLIFIED_API LPCTSTR IDS_TITLE; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_LOGO_DESC; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_LOGO_AGORAWEB; - -extern CHINESESIMPLIFIED_API LPCTSTR IDS_CONTACT; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_PHONENUMBER; - -extern CHINESESIMPLIFIED_API LPCTSTR IDS_PRE_TITLE; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_PRE_OPTDSC1; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_PRE_OPTDSC2; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_PRE_WEBDSC1; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_PRE_WEBDSC2; - -extern CHINESESIMPLIFIED_API LPCTSTR IDS_PRE_BTNOPT; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_PRE_BTNWEB; - -extern CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_TITLE; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_DSC1; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_DSC2; -//extern CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_DSC3; -//extern CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_DSC4; - -extern CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_BTBACK; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_BTTEST; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_BTJOIN; - -extern CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_CHTIP; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_KEYTIP; - -extern CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_ENCTYPE; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_AES128XTS; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_AES128GCM; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_AES128CCM; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_AES128CTR; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_AES256XTS; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_AES256GCM; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_AES256CCM; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_CHN_AES256CTR; - -extern CHINESESIMPLIFIED_API LPCTSTR IDS_SET_RESOLUTION; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_SET_MFR; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_SET_MR; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_SET_BTCONFIRM; - -extern CHINESESIMPLIFIED_API LPCTSTR IDS_SET_CODEC; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_SET_SWAPWH; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_SET_SAVESETTING; - -extern CHINESESIMPLIFIED_API LPCTSTR IDS_DEVICE_AUDIOIN; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_DEVICE_AUDIOOUT; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_DEVICE_CAMERA; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_DEVICE_VOLUME; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_DEVICE_BTNTEST; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_DEVICE_BTNTESTOFF; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_DEVICE_CANCEL; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_DEVICE_CONFIRM; - -extern CHINESESIMPLIFIED_API LPCTSTR IDS_VIDEO_SCRSHARE; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_VIDEO_WNDSHARE; - -extern CHINESESIMPLIFIED_API LPCTSTR IDS_VIDEO_WBHOST; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_VIDEO_WBGUEST; - -extern CHINESESIMPLIFIED_API LPCTSTR IDS_VIDEO_MOREINFO; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_VIDEO_MOREDEVICE; -extern CHINESESIMPLIFIED_API LPCTSTR IDS_VIDEO_MOREFILTER; - - diff --git a/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/ChineseSimplified.vcxproj b/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/ChineseSimplified.vcxproj deleted file mode 100644 index 794937d5..00000000 --- a/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/ChineseSimplified.vcxproj +++ /dev/null @@ -1,190 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {898289D0-0D57-4B8E-97AE-013114F85DE9} - Win32Proj - ChineseSimplified - - - - DynamicLibrary - true - v120 - Unicode - - - DynamicLibrary - true - v120 - Unicode - - - DynamicLibrary - false - v120_xp - true - Unicode - - - DynamicLibrary - false - v120_xp - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(SolutionDir)$(Configuration)\Language\ - - - true - $(SolutionDir)\$(Configuration)\Language\ - $(Configuration)\ - - - false - $(SolutionDir)$(Configuration)\Language\ - - - false - $(SolutionDir)\$(Configuration)\Language\ - $(Configuration)\ - - - - Use - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;CHINESESIMPLIFIED_EXPORTS;%(PreprocessorDefinitions) - true - - - Windows - true - Source.def - - - - - Use - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;CHINESESIMPLIFIED_EXPORTS;%(PreprocessorDefinitions) - true - - - Windows - true - Source.def - - - - - Level3 - Use - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;CHINESESIMPLIFIED_EXPORTS;%(PreprocessorDefinitions) - true - MultiThreaded - - - Windows - true - true - true - Source.def - - - - - Level3 - Use - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;CHINESESIMPLIFIED_EXPORTS;%(PreprocessorDefinitions) - true - MultiThreaded - - - Windows - true - true - true - Source.def - - - - - - - - - - - - - - false - false - - - - - false - false - - - - - - - Create - Create - Create - Create - - - - - - - - - \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/ChineseSimplified.vcxproj.filters b/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/ChineseSimplified.vcxproj.filters deleted file mode 100644 index 11e14998..00000000 --- a/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/ChineseSimplified.vcxproj.filters +++ /dev/null @@ -1,47 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - - - - 头文件 - - - 头文件 - - - 头文件 - - - - - 源文件 - - - 源文件 - - - 源文件 - - - - - 源文件 - - - \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/Source.def b/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/Source.def deleted file mode 100644 index ebb6cb8a..00000000 --- a/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/Source.def +++ /dev/null @@ -1,66 +0,0 @@ -LIBRARY -EXPORTS - -IDS_TITLE DATA; - -IDS_LOGO_DESC DATA; -IDS_LOGO_AGORAWEB DATA; -IDS_CONTACT DATA; -IDS_PHONENUMBER DATA; - -IDS_PRE_TITLE DATA; -IDS_PRE_OPTDSC1 DATA; -IDS_PRE_OPTDSC2 DATA; -IDS_PRE_WEBDSC1 DATA; -IDS_PRE_WEBDSC2 DATA; - -IDS_PRE_BTNOPT DATA; -IDS_PRE_BTNWEB DATA; - -IDS_CHN_TITLE DATA; -IDS_CHN_DSC1 DATA; -IDS_CHN_DSC2 DATA; - -IDS_CHN_BTBACK DATA; -IDS_CHN_BTTEST DATA; -IDS_CHN_BTJOIN DATA; - -IDS_CHN_CHTIP DATA; -IDS_CHN_KEYTIP DATA; -IDS_CHN_ENCTYPE DATA; - -IDS_CHN_AES128XTS DATA; -IDS_CHN_AES128GCM DATA; -IDS_CHN_AES128CCM DATA; -IDS_CHN_AES128CTR DATA; -IDS_CHN_AES256XTS DATA; -IDS_CHN_AES256GCM DATA; -IDS_CHN_AES256CCM DATA; -IDS_CHN_AES256CTR DATA; - -IDS_SET_RESOLUTION DATA; -IDS_SET_MFR DATA; -IDS_SET_MR DATA; -IDS_SET_BTCONFIRM DATA; - -IDS_SET_CODEC DATA; -IDS_SET_SWAPWH DATA; -IDS_SET_SAVESETTING DATA; - -IDS_DEVICE_AUDIOIN DATA; -IDS_DEVICE_AUDIOOUT DATA; -IDS_DEVICE_CAMERA DATA; -IDS_DEVICE_VOLUME DATA; -IDS_DEVICE_BTNTEST DATA; -IDS_DEVICE_BTNTESTOFF DATA; -IDS_DEVICE_CANCEL DATA; -IDS_DEVICE_CONFIRM DATA; - -IDS_VIDEO_SCRSHARE DATA; -IDS_VIDEO_WNDSHARE DATA; -IDS_VIDEO_WBHOST DATA; -IDS_VIDEO_WBGUEST DATA; - -IDS_VIDEO_MOREINFO DATA; -IDS_VIDEO_MOREDEVICE DATA; -IDS_VIDEO_MOREFILTER DATA;LIBRARY diff --git a/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/dllmain.cpp b/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/dllmain.cpp deleted file mode 100644 index 260abc6d..00000000 --- a/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/dllmain.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// dllmain.cpp : DLL Ӧóڵ㡣 -#include "stdafx.h" - -BOOL APIENTRY DllMain( HMODULE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved - ) -{ - switch (ul_reason_for_call) - { - case DLL_PROCESS_ATTACH: - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - case DLL_PROCESS_DETACH: - break; - } - return TRUE; -} - diff --git a/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/stdafx.cpp b/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/stdafx.cpp deleted file mode 100644 index fd46dc5b..00000000 --- a/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/stdafx.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// stdafx.cpp : ֻ׼ļԴļ -// ChineseSimplified.pch ΪԤͷ -// stdafx.obj ԤϢ - -#include "stdafx.h" - -// TODO: STDAFX.H -// κĸͷļڴļ diff --git a/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/stdafx.h b/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/stdafx.h deleted file mode 100644 index 254f1ef8..00000000 --- a/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/stdafx.h +++ /dev/null @@ -1,14 +0,0 @@ -// stdafx.h : ׼ϵͳļİļ -// Ǿʹõĵ -// ضĿİļ -// - -#pragma once - -#include "targetver.h" - -#define WIN32_LEAN_AND_MEAN // Windows ͷļųʹõϢ -// Windows ͷļ: -#include -#include -// TODO: ڴ˴óҪͷļ diff --git a/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/targetver.h b/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/targetver.h deleted file mode 100644 index 7a7d2c83..00000000 --- a/Group-Video/OpenVideoCall-Windows/Language/ChineseSimplified/targetver.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -// SDKDDKVer.h õ߰汾 Windows ƽ̨ - -// ҪΪǰ Windows ƽ̨Ӧó WinSDKVer.h -// WIN32_WINNT ΪҪֵ֧ƽ̨Ȼٰ SDKDDKVer.h - -#include diff --git a/Group-Video/OpenVideoCall-Windows/Language/English/English.cpp b/Group-Video/OpenVideoCall-Windows/Language/English/English.cpp deleted file mode 100644 index ecc56032..00000000 --- a/Group-Video/OpenVideoCall-Windows/Language/English/English.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// English.cpp : DLL Ӧóĵ -// - -#include "stdafx.h" -#include "English.h" - - - -ENGLISH_API LPCTSTR IDS_TITLE = _T("Open Video Call"); -ENGLISH_API LPCTSTR IDS_LOGO_DESC = _T("Powering Real-Time Communications"); -ENGLISH_API LPCTSTR IDS_LOGO_AGORAWEB = _T("agora.io"); - -ENGLISH_API LPCTSTR IDS_CONTACT = _T("Contact support: "); -ENGLISH_API LPCTSTR IDS_PHONENUMBER = _T("400 632 6626"); - -ENGLISH_API LPCTSTR IDS_PRE_TITLE = _T("Slelct conference type"); -ENGLISH_API LPCTSTR IDS_PRE_OPTDSC1 = _T("* Optimized calls have best performance but"); -ENGLISH_API LPCTSTR IDS_PRE_OPTDSC2 = _T(" cannot be joined by web participants"); -ENGLISH_API LPCTSTR IDS_PRE_WEBDSC1 = _T("* Web-compatible calls have goog performance"); -ENGLISH_API LPCTSTR IDS_PRE_WEBDSC2 = _T(" and open to web participants"); -ENGLISH_API LPCTSTR IDS_PRE_BTNOPT = _T("Optimized"); -ENGLISH_API LPCTSTR IDS_PRE_BTNWEB = _T("Web-compatible"); - -ENGLISH_API LPCTSTR IDS_CHN_TITLE = _T("Enter a conference room name"); -ENGLISH_API LPCTSTR IDS_CHN_DSC1 = _T("if you are the first person to specify this name,the room will be created and you will be"); -ENGLISH_API LPCTSTR IDS_CHN_DSC2 = _T("placed in it.if it has already been created you will join the conference in progress"); -// ENGLISH_API LPCTSTR IDS_CHN_DSC3 = _T(""); -// ENGLISH_API LPCTSTR IDS_CHN_DSC4 = _T("progress"); - -ENGLISH_API LPCTSTR IDS_CHN_BTBACK = _T("Back"); -ENGLISH_API LPCTSTR IDS_CHN_BTTEST = _T("Test"); -ENGLISH_API LPCTSTR IDS_CHN_BTJOIN = _T("Join"); - -ENGLISH_API LPCTSTR IDS_CHN_CHTIP = _T("ChannelName"); -ENGLISH_API LPCTSTR IDS_CHN_KEYTIP = _T("EncryptionKey"); - -ENGLISH_API LPCTSTR IDS_CHN_ENCTYPE = _T("EncType:"); -ENGLISH_API LPCTSTR IDS_CHN_AES128XTS = _T("aes-128"); -ENGLISH_API LPCTSTR IDS_CHN_AES128GCM = _T("aes-128-gcm"); -ENGLISH_API LPCTSTR IDS_CHN_AES128CCM = _T("aes-128-ccm"); -ENGLISH_API LPCTSTR IDS_CHN_AES128CTR = _T("aes-128-ctr"); -ENGLISH_API LPCTSTR IDS_CHN_AES256XTS = _T("aes-256"); -ENGLISH_API LPCTSTR IDS_CHN_AES256GCM = _T("aes-256-gcm"); -ENGLISH_API LPCTSTR IDS_CHN_AES256CCM = _T("aes-256-ccm"); -ENGLISH_API LPCTSTR IDS_CHN_AES256CTR = _T("aes-256-ctr"); - -ENGLISH_API LPCTSTR IDS_SET_RESOLUTION = _T("Resolution"); -ENGLISH_API LPCTSTR IDS_SET_MFR = _T("Max Frame rate"); -ENGLISH_API LPCTSTR IDS_SET_MR = _T("Max rate"); -ENGLISH_API LPCTSTR IDS_SET_BTCONFIRM = _T("Confirm"); - -ENGLISH_API LPCTSTR IDS_SET_CODEC = _T("Codec"); -ENGLISH_API LPCTSTR IDS_SET_SWAPWH = _T("swap wide and height"); -ENGLISH_API LPCTSTR IDS_SET_SAVESETTING = _T("save the settings"); - -ENGLISH_API LPCTSTR IDS_DEVICE_AUDIOIN = _T("Input Device:"); -ENGLISH_API LPCTSTR IDS_DEVICE_AUDIOOUT = _T("Output Device:"); -ENGLISH_API LPCTSTR IDS_DEVICE_CAMERA = _T("Camera:"); -ENGLISH_API LPCTSTR IDS_DEVICE_VOLUME = _T("Volume"); -ENGLISH_API LPCTSTR IDS_DEVICE_BTNTEST = _T("test"); -ENGLISH_API LPCTSTR IDS_DEVICE_BTNTESTOFF = _T("Stop"); -ENGLISH_API LPCTSTR IDS_DEVICE_CANCEL = _T("Cancel"); -ENGLISH_API LPCTSTR IDS_DEVICE_CONFIRM = _T("Confirm"); - -ENGLISH_API LPCTSTR IDS_VIDEO_SCRSHARE = _T("Screen Share"); -ENGLISH_API LPCTSTR IDS_VIDEO_WNDSHARE = _T("Window Share"); - -ENGLISH_API LPCTSTR IDS_VIDEO_WBHOST = _T("Host Mode"); -ENGLISH_API LPCTSTR IDS_VIDEO_WBGUEST = _T("Guest Mode"); - -ENGLISH_API LPCTSTR IDS_VIDEO_MOREINFO = _T("Video Info"); -ENGLISH_API LPCTSTR IDS_VIDEO_MOREDEVICE = _T("Device"); -ENGLISH_API LPCTSTR IDS_VIDEO_MOREFILTER = _T("Video Filter"); \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/Language/English/English.h b/Group-Video/OpenVideoCall-Windows/Language/English/English.h deleted file mode 100644 index 720907e3..00000000 --- a/Group-Video/OpenVideoCall-Windows/Language/English/English.h +++ /dev/null @@ -1,79 +0,0 @@ -// ifdef Ǵʹ DLL 򵥵 -// ı׼ DLL еļ϶ ENGLISH_EXPORTS -// űġʹô DLL -// κĿϲӦ˷šԴļаļκĿὫ -// ENGLISH_API ΪǴ DLL ģ DLL ô˺궨 -// ΪDZġ -#ifdef ENGLISH_EXPORTS -#define ENGLISH_API __declspec(dllexport) -#else -#define ENGLISH_API __declspec(dllimport) -#endif - - -extern ENGLISH_API LPCTSTR IDS_TITLE; -extern ENGLISH_API LPCTSTR IDS_LOGO_DESC; -extern ENGLISH_API LPCTSTR IDS_LOGO_AGORAWEB; - -extern ENGLISH_API LPCTSTR IDS_CONTACT; -extern ENGLISH_API LPCTSTR IDS_PHONENUMBER; - -extern ENGLISH_API LPCTSTR IDS_PRE_TITLE; -extern ENGLISH_API LPCTSTR IDS_PRE_OPTDSC1; -extern ENGLISH_API LPCTSTR IDS_PRE_OPTDSC2; -extern ENGLISH_API LPCTSTR IDS_PRE_WEBDSC1; -extern ENGLISH_API LPCTSTR IDS_PRE_WEBDSC2; - -extern ENGLISH_API LPCTSTR IDS_PRE_BTNOPT; -extern ENGLISH_API LPCTSTR IDS_PRE_BTNWEB; - -extern ENGLISH_API LPCTSTR IDS_CHN_TITLE; -extern ENGLISH_API LPCTSTR IDS_CHN_DSC1; -extern ENGLISH_API LPCTSTR IDS_CHN_DSC2; -//extern ENGLISH_API LPCTSTR IDS_CHN_DSC3; -//extern ENGLISH_API LPCTSTR IDS_CHN_DSC4; - -extern ENGLISH_API LPCTSTR IDS_CHN_BTBACK; -extern ENGLISH_API LPCTSTR IDS_CHN_BTTEST; -extern ENGLISH_API LPCTSTR IDS_CHN_BTJOIN; - -extern ENGLISH_API LPCTSTR IDS_CHN_CHTIP; -extern ENGLISH_API LPCTSTR IDS_CHN_KEYTIP; - -extern ENGLISH_API LPCTSTR IDS_CHN_ENCTYPE; -extern ENGLISH_API LPCTSTR IDS_CHN_AES128XTS; -extern ENGLISH_API LPCTSTR IDS_CHN_AES128GCM; -extern ENGLISH_API LPCTSTR IDS_CHN_AES128CCM; -extern ENGLISH_API LPCTSTR IDS_CHN_AES128CTR; -extern ENGLISH_API LPCTSTR IDS_CHN_AES256XTS; -extern ENGLISH_API LPCTSTR IDS_CHN_AES256GCM; -extern ENGLISH_API LPCTSTR IDS_CHN_AES256CCM; -extern ENGLISH_API LPCTSTR IDS_CHN_AES256CTR; - -extern ENGLISH_API LPCTSTR IDS_SET_RESOLUTION; -extern ENGLISH_API LPCTSTR IDS_SET_MFR; -extern ENGLISH_API LPCTSTR IDS_SET_MR; -extern ENGLISH_API LPCTSTR IDS_SET_BTCONFIRM; - -extern ENGLISH_API LPCTSTR IDS_SET_CODEC; -extern ENGLISH_API LPCTSTR IDS_SET_SWAPWH; -extern ENGLISH_API LPCTSTR IDS_SET_SAVESETTING; - -extern ENGLISH_API LPCTSTR IDS_DEVICE_AUDIOIN; -extern ENGLISH_API LPCTSTR IDS_DEVICE_AUDIOOUT; -extern ENGLISH_API LPCTSTR IDS_DEVICE_CAMERA; -extern ENGLISH_API LPCTSTR IDS_DEVICE_VOLUME; -extern ENGLISH_API LPCTSTR IDS_DEVICE_BTNTEST; -extern ENGLISH_API LPCTSTR IDS_DEVICE_BTNTESTOFF; -extern ENGLISH_API LPCTSTR IDS_DEVICE_CANCEL; -extern ENGLISH_API LPCTSTR IDS_DEVICE_CONFIRM; - -extern ENGLISH_API LPCTSTR IDS_VIDEO_SCRSHARE; -extern ENGLISH_API LPCTSTR IDS_VIDEO_WNDSHARE; - -extern ENGLISH_API LPCTSTR IDS_VIDEO_WBHOST; -extern ENGLISH_API LPCTSTR IDS_VIDEO_WBGUEST; - -extern ENGLISH_API LPCTSTR IDS_VIDEO_MOREINFO; -extern ENGLISH_API LPCTSTR IDS_VIDEO_MOREDEVICE; -extern ENGLISH_API LPCTSTR IDS_VIDEO_MOREFILTER; diff --git a/Group-Video/OpenVideoCall-Windows/Language/English/English.vcxproj b/Group-Video/OpenVideoCall-Windows/Language/English/English.vcxproj deleted file mode 100644 index b0d849c1..00000000 --- a/Group-Video/OpenVideoCall-Windows/Language/English/English.vcxproj +++ /dev/null @@ -1,190 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {DE1D9363-5455-4448-8D69-D22BE47F5A82} - Win32Proj - English - - - - DynamicLibrary - true - v120 - Unicode - - - DynamicLibrary - true - v120 - Unicode - - - DynamicLibrary - false - v120_xp - true - Unicode - - - DynamicLibrary - false - v120_xp - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(SolutionDir)$(Configuration)\Language\ - - - true - $(SolutionDir)\$(Configuration)\Language\ - $(Configuration)\ - - - false - $(SolutionDir)$(Configuration)\Language\ - - - false - $(SolutionDir)\$(Configuration)\Language\ - $(Configuration)\ - - - - Use - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;ENGLISH_EXPORTS;%(PreprocessorDefinitions) - true - - - Windows - true - Source.def - - - - - Use - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;ENGLISH_EXPORTS;%(PreprocessorDefinitions) - true - - - Windows - true - Source.def - - - - - Level3 - Use - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;ENGLISH_EXPORTS;%(PreprocessorDefinitions) - true - MultiThreaded - - - Windows - true - true - true - Source.def - - - - - Level3 - Use - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;ENGLISH_EXPORTS;%(PreprocessorDefinitions) - true - MultiThreaded - - - Windows - true - true - true - Source.def - - - - - - - - - - - - - false - false - - - - - false - false - - - - - - - - Create - Create - Create - Create - - - - - - - - - \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/Language/English/English.vcxproj.filters b/Group-Video/OpenVideoCall-Windows/Language/English/English.vcxproj.filters deleted file mode 100644 index 9b69fb3a..00000000 --- a/Group-Video/OpenVideoCall-Windows/Language/English/English.vcxproj.filters +++ /dev/null @@ -1,47 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - - - - 头文件 - - - 头文件 - - - 头文件 - - - - - 源文件 - - - 源文件 - - - 源文件 - - - - - 源文件 - - - \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/Language/English/Source.def b/Group-Video/OpenVideoCall-Windows/Language/English/Source.def deleted file mode 100644 index d1e513ec..00000000 --- a/Group-Video/OpenVideoCall-Windows/Language/English/Source.def +++ /dev/null @@ -1,66 +0,0 @@ -LIBRARY -EXPORTS - -IDS_TITLE DATA; - -IDS_LOGO_DESC DATA; -IDS_LOGO_AGORAWEB DATA; -IDS_CONTACT DATA; -IDS_PHONENUMBER DATA; - -IDS_PRE_TITLE DATA; -IDS_PRE_OPTDSC1 DATA; -IDS_PRE_OPTDSC2 DATA; -IDS_PRE_WEBDSC1 DATA; -IDS_PRE_WEBDSC2 DATA; - -IDS_PRE_BTNOPT DATA; -IDS_PRE_BTNWEB DATA; - -IDS_CHN_TITLE DATA; -IDS_CHN_DSC1 DATA; -IDS_CHN_DSC2 DATA; - -IDS_CHN_BTBACK DATA; -IDS_CHN_BTTEST DATA; -IDS_CHN_BTJOIN DATA; - -IDS_CHN_CHTIP DATA; -IDS_CHN_KEYTIP DATA; -IDS_CHN_ENCTYPE DATA; - -IDS_CHN_AES128XTS DATA; -IDS_CHN_AES128GCM DATA; -IDS_CHN_AES128CCM DATA; -IDS_CHN_AES128CTR DATA; -IDS_CHN_AES256XTS DATA; -IDS_CHN_AES256GCM DATA; -IDS_CHN_AES256CCM DATA; -IDS_CHN_AES256CTR DATA; - -IDS_SET_RESOLUTION DATA; -IDS_SET_MFR DATA; -IDS_SET_MR DATA; -IDS_SET_BTCONFIRM DATA; - -IDS_SET_CODEC DATA; -IDS_SET_SWAPWH DATA; -IDS_SET_SAVESETTING DATA; - -IDS_DEVICE_AUDIOIN DATA; -IDS_DEVICE_AUDIOOUT DATA; -IDS_DEVICE_CAMERA DATA; -IDS_DEVICE_VOLUME DATA; -IDS_DEVICE_BTNTEST DATA; -IDS_DEVICE_BTNTESTOFF DATA; -IDS_DEVICE_CANCEL DATA; -IDS_DEVICE_CONFIRM DATA; - -IDS_VIDEO_SCRSHARE DATA; -IDS_VIDEO_WNDSHARE DATA; -IDS_VIDEO_WBHOST DATA; -IDS_VIDEO_WBGUEST DATA; - -IDS_VIDEO_MOREINFO DATA; -IDS_VIDEO_MOREDEVICE DATA; -IDS_VIDEO_MOREFILTER DATA; \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/Language/English/dllmain.cpp b/Group-Video/OpenVideoCall-Windows/Language/English/dllmain.cpp deleted file mode 100644 index 260abc6d..00000000 --- a/Group-Video/OpenVideoCall-Windows/Language/English/dllmain.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// dllmain.cpp : DLL Ӧóڵ㡣 -#include "stdafx.h" - -BOOL APIENTRY DllMain( HMODULE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved - ) -{ - switch (ul_reason_for_call) - { - case DLL_PROCESS_ATTACH: - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - case DLL_PROCESS_DETACH: - break; - } - return TRUE; -} - diff --git a/Group-Video/OpenVideoCall-Windows/Language/English/stdafx.cpp b/Group-Video/OpenVideoCall-Windows/Language/English/stdafx.cpp deleted file mode 100644 index cfb88915..00000000 --- a/Group-Video/OpenVideoCall-Windows/Language/English/stdafx.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// stdafx.cpp : ֻ׼ļԴļ -// English.pch ΪԤͷ -// stdafx.obj ԤϢ - -#include "stdafx.h" - -// TODO: STDAFX.H -// κĸͷļڴļ diff --git a/Group-Video/OpenVideoCall-Windows/Language/English/stdafx.h b/Group-Video/OpenVideoCall-Windows/Language/English/stdafx.h deleted file mode 100644 index 644ba2c0..00000000 --- a/Group-Video/OpenVideoCall-Windows/Language/English/stdafx.h +++ /dev/null @@ -1,16 +0,0 @@ -// stdafx.h : ׼ϵͳļİļ -// Ǿʹõĵ -// ضĿİļ -// - -#pragma once - -#include "targetver.h" - -#define WIN32_LEAN_AND_MEAN // Windows ͷļųʹõϢ -// Windows ͷļ: -#include -#include - - -// TODO: ڴ˴óҪͷļ diff --git a/Group-Video/OpenVideoCall-Windows/Language/English/targetver.h b/Group-Video/OpenVideoCall-Windows/Language/English/targetver.h deleted file mode 100644 index 7a7d2c83..00000000 --- a/Group-Video/OpenVideoCall-Windows/Language/English/targetver.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -// SDKDDKVer.h õ߰汾 Windows ƽ̨ - -// ҪΪǰ Windows ƽ̨Ӧó WinSDKVer.h -// WIN32_WINNT ΪҪֵ֧ƽ̨Ȼٰ SDKDDKVer.h - -#include diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall.pro b/Group-Video/OpenVideoCall-Windows/OpenVideoCall.pro new file mode 100644 index 00000000..704c0013 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/OpenVideoCall.pro @@ -0,0 +1,76 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2019-09-24T10:52:31 +# +#------------------------------------------------- + +QT += core gui quickwidgets + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = OpenVideoCall +TEMPLATE = app + + +SOURCES += main.cpp \ + agoraconfig.cpp \ + openvideocall.cpp \ + avdevice.cpp \ + agoraobject.cpp \ + nettesting.cpp \ + nettestresult.cpp \ + nettestdetail.cpp \ + agorawindowmanager.cpp \ + enterroom.cpp \ + inroom.cpp + +HEADERS += \ + agoraconfig.h \ + openvideocall.h \ + avdevice.h \ + agoraobject.h \ + nettesting.h \ + nettestresult.h \ + nettestdetail.h \ + agorawindowmanager.h \ + enterroom.h \ + inroom.h + +FORMS += \ + openvideocall.ui \ + avdevice.ui \ + nettesting.ui \ + nettestresult.ui \ + nettestdetail.ui \ + enterroom.ui \ + inroom.ui + +RESOURCES += \ + openvideocall.qrc + +RC_FILE = openvideocall.rc + +DISTFILES += \ + uiresource/OVC-win-more users.jpg \ + uiresource/icon-back hover.png \ + uiresource/icon-camera hover.png \ + uiresource/icon-camera off.png \ + uiresource/icon-close hover.png \ + uiresource/icon-hang up hover.png \ + uiresource/icon-hang up.png \ + uiresource/icon-micorophone hover.png \ + uiresource/icon-micorophone off.png \ + uiresource/icon-setting hover.png \ + openvideocall.rc + +win32: { +INCLUDEPATH += $$PWD/sdk/include +LIBS += -L$$PWD/sdk/lib/ -lagora_rtc_sdk +LIBS += User32.LIB +} + +win64: { +INCLUDEPATH += $$PWD/sdk/include +LIBS += -L$$PWD/sdk/lib/ -lagora_rtc_sdk +LIBS += User32.LIB +} diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall.sln b/Group-Video/OpenVideoCall-Windows/OpenVideoCall.sln deleted file mode 100644 index b4b1f5ff..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall.sln +++ /dev/null @@ -1,58 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.40629.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenVideoCall", "OpenVideoCall\OpenVideoCall.vcxproj", "{26AF88DC-1933-4A1B-9991-21DF11DCE388}" - ProjectSection(ProjectDependencies) = postProject - {DE1D9363-5455-4448-8D69-D22BE47F5A82} = {DE1D9363-5455-4448-8D69-D22BE47F5A82} - {898289D0-0D57-4B8E-97AE-013114F85DE9} = {898289D0-0D57-4B8E-97AE-013114F85DE9} - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Language", "Language", "{4E3673B0-1BE6-41B7-9060-17A0B272CF19}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "English", "Language\English\English.vcxproj", "{DE1D9363-5455-4448-8D69-D22BE47F5A82}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ChineseSimplified", "Language\ChineseSimplified\ChineseSimplified.vcxproj", "{898289D0-0D57-4B8E-97AE-013114F85DE9}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {26AF88DC-1933-4A1B-9991-21DF11DCE388}.Debug|Win32.ActiveCfg = Debug|Win32 - {26AF88DC-1933-4A1B-9991-21DF11DCE388}.Debug|Win32.Build.0 = Debug|Win32 - {26AF88DC-1933-4A1B-9991-21DF11DCE388}.Debug|x64.ActiveCfg = Debug|x64 - {26AF88DC-1933-4A1B-9991-21DF11DCE388}.Debug|x64.Build.0 = Debug|x64 - {26AF88DC-1933-4A1B-9991-21DF11DCE388}.Release|Win32.ActiveCfg = Release|Win32 - {26AF88DC-1933-4A1B-9991-21DF11DCE388}.Release|Win32.Build.0 = Release|Win32 - {26AF88DC-1933-4A1B-9991-21DF11DCE388}.Release|x64.ActiveCfg = Release|x64 - {26AF88DC-1933-4A1B-9991-21DF11DCE388}.Release|x64.Build.0 = Release|x64 - {DE1D9363-5455-4448-8D69-D22BE47F5A82}.Debug|Win32.ActiveCfg = Debug|Win32 - {DE1D9363-5455-4448-8D69-D22BE47F5A82}.Debug|Win32.Build.0 = Debug|Win32 - {DE1D9363-5455-4448-8D69-D22BE47F5A82}.Debug|x64.ActiveCfg = Debug|x64 - {DE1D9363-5455-4448-8D69-D22BE47F5A82}.Debug|x64.Build.0 = Debug|x64 - {DE1D9363-5455-4448-8D69-D22BE47F5A82}.Release|Win32.ActiveCfg = Release|Win32 - {DE1D9363-5455-4448-8D69-D22BE47F5A82}.Release|Win32.Build.0 = Release|Win32 - {DE1D9363-5455-4448-8D69-D22BE47F5A82}.Release|x64.ActiveCfg = Release|x64 - {DE1D9363-5455-4448-8D69-D22BE47F5A82}.Release|x64.Build.0 = Release|x64 - {898289D0-0D57-4B8E-97AE-013114F85DE9}.Debug|Win32.ActiveCfg = Debug|Win32 - {898289D0-0D57-4B8E-97AE-013114F85DE9}.Debug|Win32.Build.0 = Debug|Win32 - {898289D0-0D57-4B8E-97AE-013114F85DE9}.Debug|x64.ActiveCfg = Debug|x64 - {898289D0-0D57-4B8E-97AE-013114F85DE9}.Debug|x64.Build.0 = Debug|x64 - {898289D0-0D57-4B8E-97AE-013114F85DE9}.Release|Win32.ActiveCfg = Release|Win32 - {898289D0-0D57-4B8E-97AE-013114F85DE9}.Release|Win32.Build.0 = Release|Win32 - {898289D0-0D57-4B8E-97AE-013114F85DE9}.Release|x64.ActiveCfg = Release|x64 - {898289D0-0D57-4B8E-97AE-013114F85DE9}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {DE1D9363-5455-4448-8D69-D22BE47F5A82} = {4E3673B0-1BE6-41B7-9060-17A0B272CF19} - {898289D0-0D57-4B8E-97AE-013114F85DE9} = {4E3673B0-1BE6-41B7-9060-17A0B272CF19} - EndGlobalSection -EndGlobal diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGButton.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGButton.cpp deleted file mode 100644 index 9c82046f..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGButton.cpp +++ /dev/null @@ -1,308 +0,0 @@ -// AGButton.cpp : ʵļ -// - -#include "stdafx.h" -#include "AGButton.h" - - -// CAGButton - -IMPLEMENT_DYNAMIC(CAGButton, CButton) - -CAGButton::CAGButton() -{ - m_crBorderNormal = RGB(0, 160, 239); - m_crBorderHover = RGB(0, 160, 239); - m_crBorderPush = RGB(0, 160, 239); - m_crBorderDisable = RGB(0, 160, 239); - - m_crBackNormal = RGB(0, 160, 239); - m_crBackHover = RGB(0, 160, 239); - m_crBackPush = RGB(0, 160, 239); - m_crBackDisable = RGB(0, 160, 239); - - m_crTextNormal = RGB(0xFF, 0xFF, 0xFF); - m_crTextHover = RGB(0xFF, 0xC8, 0x64); - m_crTextPush = RGB(0xFF, 0xC8, 0x64); - m_crTextDisable = RGB(0xCC, 0xCC, 0xCC); - - m_bHover = FALSE; - m_bMouseTrack = FALSE; - m_bFrameEffect = TRUE; - - m_nDefStatus = AGBTN_NORMAL; -} - -CAGButton::~CAGButton() -{ - m_imgBack.DeleteImageList(); -} - - -BEGIN_MESSAGE_MAP(CAGButton, CButton) - ON_WM_MOUSEMOVE() - ON_WM_MOUSELEAVE() - ON_WM_ERASEBKGND() -END_MESSAGE_MAP() - - - -// CAGButton Ϣ - -BOOL CAGButton::SetBackImage(UINT nIDResource, COLORREF crMask) -{ - CBitmap bmBackImage; - BITMAP bmImageInfo; - - if (!bmBackImage.LoadBitmap(nIDResource)) - return FALSE; - - bmBackImage.GetBitmap(&bmImageInfo); - - m_imgBack.DeleteImageList(); - if (!m_imgBack.Create(bmImageInfo.bmWidth / 4, bmImageInfo.bmHeight, ILC_COLOR24 | ILC_MASK, 4, 1)) - return FALSE; - - m_imgBack.Add(&bmBackImage, crMask); - bmBackImage.DeleteObject(); - - Invalidate(FALSE); - - return TRUE; -} - -void CAGButton::SetBackColor(COLORREF crNormal, COLORREF crHover, COLORREF crPush, COLORREF crDisable) -{ - m_crBackNormal = crNormal; - m_crBackHover = crHover; - m_crBackPush = crPush; - m_crBackDisable = crDisable; - - Invalidate(FALSE); -} - -void CAGButton::SetTextColor(COLORREF crNormal, COLORREF crHover, COLORREF crPush, COLORREF crDisable) -{ - m_crTextNormal = crNormal; - m_crTextHover = crHover; - m_crTextPush = crPush; - m_crTextDisable = crDisable; - - Invalidate(FALSE); -} - -void CAGButton::SetBorderColor(COLORREF crNormal, COLORREF crHover, COLORREF crPush, COLORREF crDisable) -{ - m_crBorderNormal = crNormal; - m_crBorderHover = crHover; - m_crBorderPush = crPush; - m_crBorderDisable = crDisable; - - Invalidate(FALSE); -} - -void CAGButton::EnableFrameEffect(BOOL bEnable) -{ - m_bFrameEffect = bEnable; - Invalidate(FALSE); -} - -void CAGButton::PreSubclassWindow() -{ - // TODO: ڴרô/û - ModifyStyle(0, BS_OWNERDRAW); - - CButton::PreSubclassWindow(); -} - - - -void CAGButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) -{ - ASSERT(lpDrawItemStruct->CtlType == ODT_BUTTON); - - UINT nStat = m_nDefStatus; - UINT uStyle = DFCS_BUTTONPUSH; - - if (m_bHover && m_nDefStatus == AGBTN_NORMAL) - nStat = AGBTN_HOVER; - - if (lpDrawItemStruct->itemState & ODS_SELECTED) { - uStyle |= DFCS_PUSHED; - nStat = AGBTN_PUSH; - } - else if (lpDrawItemStruct->itemState & ODS_DISABLED) - nStat = AGBTN_DISABLE; - - DrawBack(lpDrawItemStruct, nStat); - DrawText(lpDrawItemStruct, nStat); - - if (m_bFrameEffect) - DrawFrame(lpDrawItemStruct, nStat); -} - -void CAGButton::DrawBack(LPDRAWITEMSTRUCT lpDrawItemStruct, UINT nStat) -{ - int nImageIndex = -1; - COLORREF crBackColor = m_crBackNormal; - CDC *pDC = CDC::FromHandle(lpDrawItemStruct->hDC); - - switch (nStat) - { - case AGBTN_NORMAL: - nImageIndex = 0; - crBackColor = m_crBackNormal; - break; - case AGBTN_HOVER: - nImageIndex = 1; - crBackColor = m_crBackHover; - break; - case AGBTN_PUSH: - nImageIndex = 2; - crBackColor = m_crBackPush; - break; - case AGBTN_DISABLE: - nImageIndex = 3; - crBackColor = m_crBackDisable; - break; - default: - nImageIndex = 0; - crBackColor = m_crBackNormal; - break; - } - - if (m_imgBack.GetSafeHandle() == NULL || nImageIndex >= m_imgBack.GetImageCount()) - nImageIndex = -1; - - CRect rcButton; - CBrush brushBack; - - rcButton.CopyRect(&lpDrawItemStruct->rcItem); - brushBack.CreateSolidBrush(crBackColor); - pDC->FillRect(&rcButton, &brushBack); - - brushBack.DeleteObject(); - - if (nImageIndex != -1) - m_imgBack.Draw(pDC, nImageIndex, CPoint(0, 0), ILD_NORMAL); -} - -void CAGButton::DrawText(LPDRAWITEMSTRUCT lpDrawItemStruct, UINT nStat) -{ - CRect rcText; - CString strText; - - GetWindowText(strText); - rcText.CopyRect(&lpDrawItemStruct->rcItem); - - COLORREF crTextColor = m_crTextNormal; - CDC *pDC = CDC::FromHandle(lpDrawItemStruct->hDC); - - switch (nStat) - { - case AGBTN_NORMAL: - crTextColor = m_crTextNormal; - break; - case AGBTN_HOVER: - crTextColor = m_crTextHover; - break; - case AGBTN_PUSH: - crTextColor = m_crTextPush; - rcText.left += 1; - rcText.bottom += 1; - break; - case AGBTN_DISABLE: - crTextColor = m_crTextDisable; - break; - default: - crTextColor = m_crTextDisable; - break; - } - - COLORREF crOldColor = pDC->SetTextColor(crTextColor); - pDC->SetBkMode(TRANSPARENT); - pDC->DrawText(strText, &rcText, DT_SINGLELINE | DT_VCENTER | DT_CENTER); - pDC->SetTextColor(crOldColor); -} - -void CAGButton::DrawFrame(LPDRAWITEMSTRUCT lpDrawItemStruct, UINT nStat) -{ - CBrush brushBorder; - - CRect rcFocus(&lpDrawItemStruct->rcItem); - CDC *pDC = CDC::FromHandle(lpDrawItemStruct->hDC); - - rcFocus.left += 3; - rcFocus.right -= 3; - - rcFocus.top += 3; - rcFocus.bottom -= 3; - - switch (nStat) - { - case AGBTN_NORMAL: - brushBorder.CreateSolidBrush(m_crBorderNormal); - pDC->FrameRect(&lpDrawItemStruct->rcItem, &brushBorder); - break; - case AGBTN_HOVER: - brushBorder.CreateSolidBrush(m_crBorderHover); - pDC->DrawEdge(&lpDrawItemStruct->rcItem, BDR_RAISEDOUTER, BF_RECT); - break; - case AGBTN_PUSH: - brushBorder.CreateSolidBrush(m_crBorderPush); - pDC->DrawEdge(&lpDrawItemStruct->rcItem, BDR_SUNKENINNER, BF_RECT); - break; - case AGBTN_DISABLE: - brushBorder.CreateSolidBrush(m_crBorderDisable); - pDC->FrameRect(&lpDrawItemStruct->rcItem, &brushBorder); - break; - - default: - break; - } - - if (lpDrawItemStruct->itemState & ODS_FOCUS) - pDC->DrawFocusRect(&rcFocus); -} - -void CAGButton::OnMouseMove(UINT nFlags, CPoint point) -{ - // TODO: ڴϢ/Ĭֵ - if (!m_bHover){ - m_bHover = TRUE; - Invalidate(FALSE); - } - - if (!m_bMouseTrack) { - - TRACKMOUSEEVENT tmEvent; - - tmEvent.cbSize = sizeof(TRACKMOUSEEVENT); - tmEvent.dwFlags = TME_LEAVE; - tmEvent.hwndTrack = GetSafeHwnd(); - tmEvent.dwFlags = TME_LEAVE; - tmEvent.dwHoverTime = 1; - ::TrackMouseEvent(&tmEvent); - } - - CButton::OnMouseMove(nFlags, point); -} - - -void CAGButton::OnMouseLeave() -{ - // TODO: ڴϢ/Ĭֵ - m_bHover = FALSE; - m_bMouseTrack = FALSE; - Invalidate(FALSE); - - CButton::OnMouseLeave(); -} - -BOOL CAGButton::OnEraseBkgnd(CDC* pDC) -{ - // TODO: ڴϢ/Ĭֵ - - return TRUE; -// return CButton::OnEraseBkgnd(pDC); -} diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGButton.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGButton.h deleted file mode 100644 index 5e67d266..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGButton.h +++ /dev/null @@ -1,72 +0,0 @@ -#pragma once - - -// CAGButton - -class CAGButton : public CButton -{ - DECLARE_DYNAMIC(CAGButton) - -public: - enum { - AGBTN_NORMAL = 0, - AGBTN_HOVER, - AGBTN_PUSH, - AGBTN_DISABLE - }; - - CAGButton(); - virtual ~CAGButton(); - - BOOL SetBackImage(UINT nIDResource, COLORREF crMask = RGB(0xFF, 0x00, 0xFF)); - void SetBackColor(COLORREF crNormal, COLORREF crHover, COLORREF crPush, COLORREF crDisable); - void SetTextColor(COLORREF crNormal, COLORREF crHover, COLORREF crPush, COLORREF crDisable); - void SetBorderColor(COLORREF crNormal, COLORREF crHover, COLORREF crPush, COLORREF crDisable); - - void EnableFrameEffect(BOOL bEnable = TRUE); - void SwitchButtonStatus(UINT nStatus = AGBTN_NORMAL) { m_nDefStatus = nStatus; }; - -protected: - virtual void PreSubclassWindow(); - virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); - - afx_msg void OnMouseMove(UINT nFlags, CPoint point); - afx_msg void OnMouseLeave(); - afx_msg BOOL OnEraseBkgnd(CDC* pDC); - - DECLARE_MESSAGE_MAP() - -protected: - void DrawBack(LPDRAWITEMSTRUCT lpDrawItemStruct, UINT nStat); - void DrawText(LPDRAWITEMSTRUCT lpDrawItemStruct, UINT nStat); - void DrawFrame(LPDRAWITEMSTRUCT lpDrawItemStruct, UINT nStat); - -private: - CImageList m_imgBack; - - COLORREF m_crBackNormal; - COLORREF m_crBackHover; - COLORREF m_crBackPush; - COLORREF m_crBackDisable; - - COLORREF m_crTextNormal; - COLORREF m_crTextHover; - COLORREF m_crTextPush; - COLORREF m_crTextDisable; - - COLORREF m_crBorderNormal; - COLORREF m_crBorderHover; - COLORREF m_crBorderPush; - COLORREF m_crBorderDisable; - -private: - BOOL m_bHover; - BOOL m_bMouseTrack; - BOOL m_bFrameEffect; - - UINT m_nDefStatus; -public: - -}; - - diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGComboBox.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGComboBox.cpp deleted file mode 100644 index c660dbcd..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGComboBox.cpp +++ /dev/null @@ -1,682 +0,0 @@ -// AGComboBox.cpp : ʵļ -// - -#include "stdafx.h" -#include "AGComboBox.h" - -IMPLEMENT_DYNAMIC(CAGComboBoxList, CWnd) - -CAGComboBoxList::CAGComboBoxList() -: m_nItemCount(0) -, m_nCurSel(-1) -, m_nCurPointIndex(-1) -, m_crBack(RGB(0xF5, 0xF5, 0xF5)) -, m_crBorder(RGB(0xC8, 0xC8, 0xC8)) -, m_crText(RGB(0x00, 0x00, 0x00)) -, m_crTextHot(RGB(0x00, 0x9E, 0xEB)) -, m_lpWndFont(NULL) -{ - m_penBorder.CreatePen(PS_SOLID, 1, m_crBorder); -} - -CAGComboBoxList::~CAGComboBoxList() -{ - m_imgSel.DeleteImageList(); - m_penBorder.DeleteObject(); -} - -BEGIN_MESSAGE_MAP(CAGComboBoxList, CWnd) - ON_WM_PAINT() - ON_WM_MOUSEMOVE() -// ON_WM_MOUSELEAVE() - ON_WM_LBUTTONDOWN() - ON_WM_MOUSEWHEEL() -// ON_WM_VSCROLL() - ON_WM_CREATE() - ON_WM_SHOWWINDOW() -// ON_WM_ERASEBKGND() -END_MESSAGE_MAP() - -BOOL CAGComboBoxList::Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, CAGComboBox *pAGComboBox, UINT nID) -{ - ASSERT(pAGComboBox != NULL); - - m_lpComboBox = pAGComboBox; - - m_ctrVScroll.Create(SBS_VERT | SBS_LEFTALIGN | WS_CHILD | WS_VISIBLE, CRect(5, 30, 30, 130), this, nID+1); - - return CWnd::Create(NULL, NULL, dwStyle, rect, GetDesktopWindow(), nID, NULL); -} - -int CAGComboBoxList::GetCount() const -{ - return m_nItemCount; -} - -int CAGComboBoxList::GetCurSel() const -{ - return m_nCurSel; -} - -DWORD_PTR CAGComboBoxList::GetItemData(int nIndex) const -{ - return m_arrItemPtrData.GetAt(nIndex); -} - -void CAGComboBoxList::GetText(int nIndex, CString& rString) const -{ - rString.Empty(); - - if (m_nItemCount == 0) - return; - - if (nIndex >= 0 && nIndex < m_nItemCount) { - rString = m_arrItemString.GetAt(nIndex); - return; - } -} - -int CAGComboBoxList::SetItemData(int nIndex, DWORD_PTR dwItemData) -{ - ASSERT(nIndex >= 0 && nIndex <= m_nItemCount); - - m_arrItemPtrData.SetAt(nIndex, dwItemData); - - return nIndex; -} - -int CAGComboBoxList::AddString(LPCTSTR lpszString) -{ - return InsertString(m_nItemCount, lpszString); -} - -int CAGComboBoxList::InsertString(int nIndex, LPCTSTR lpszString) -{ - ASSERT(nIndex >= 0 && nIndex <= m_nItemCount); - - int nRet = -1; - DWORD_PTR dwItemData = 0; - - if (nIndex >= 0 && nIndex <= m_nItemCount) { - m_arrItemString.InsertAt(nIndex, lpszString); - m_arrItemPtrData.InsertAt(nIndex, dwItemData); - m_nItemCount++; - - if (m_nCurSel >= nIndex) - m_nCurSel += 1; - } - - return nRet; -} - -int CAGComboBoxList::SetCurSel(int nSelect) -{ - if (nSelect < -1 || nSelect >= m_nItemCount) - return -1; - - m_nCurSel = nSelect; - - return m_nCurSel; -} - -int CAGComboBoxList::DeleteString(int nIndex) -{ - if (nIndex < -1 || nIndex >= m_nItemCount) - return -1; - - m_arrItemPtrData.RemoveAt(nIndex, 1); - m_arrItemString.RemoveAt(nIndex, 1); - - if (m_nCurSel == nIndex) - m_nCurSel = -1; - else if (m_nCurSel > nIndex) - m_nCurSel -= 1; - - m_nItemCount--; - - return m_nItemCount; -} - -void CAGComboBoxList::ResetContent() -{ - m_arrItemPtrData.RemoveAll(); - m_arrItemString.RemoveAll(); - m_nItemCount = 0; - m_nCurSel = -1; -} - -void CAGComboBoxList::SetFont(CFont* pFont, BOOL bRedraw) -{ - ASSERT(pFont != NULL); - - m_lpWndFont = pFont; - Invalidate(bRedraw); -} - -void CAGComboBoxList::SetItemHeight(int nItemHeight) -{ - m_nPerItemHeight = nItemHeight; - Invalidate(TRUE); -} - -int CAGComboBoxList::GetItemHeight() const -{ - return m_nPerItemHeight; -} - -void CAGComboBoxList::ShowVScrollBar(BOOL bShow) -{ - -} - - -void CAGComboBoxList::OnPaint() -{ - CPaintDC dc(this); - - CRect rcClient; - CRect rcBack; - CRect rcText; - CRect rcSel; - SCROLLINFO si; - - memset(&si, 0, sizeof(SCROLLINFO)); - si.cbSize = sizeof(si); - si.fMask = SIF_ALL; - GetScrollInfo(SB_VERT, &si); - int nStartIndex = si.nPos / m_nPerItemHeight; - - GetClientRect(&rcClient); - rcBack.SetRect(rcClient.left + 1, rcClient.top + 1, rcClient.right - 1, rcClient.bottom - 1); - rcText.SetRect(5, 1, rcClient.Width() - 35, m_nPerItemHeight-2); - - dc.SetBkMode(TRANSPARENT); - CPen *lpOldPen = dc.SelectObject(&m_penBorder); - - dc.Rectangle(&rcClient); - dc.FillSolidRect(&rcBack, m_crBack); - dc.SelectObject(m_lpWndFont); - - for (int nIndex = 0; nIndex < m_nItemCount - nStartIndex; nIndex++) { - - dc.SetTextColor(m_crText); - const CString &strItem = m_arrItemString.GetAt(nIndex + nStartIndex); - - dc.FillSolidRect(&rcText, m_crBack); - if (m_nCurSel == (nStartIndex + nIndex)){ - ; - } - - if (m_nCurPointIndex == (nStartIndex + nIndex)) - dc.SetTextColor(m_crTextHot); - - dc.DrawText(strItem, &rcText, DT_SINGLELINE | DT_LEFT | DT_VCENTER | DT_END_ELLIPSIS); - rcText.OffsetRect(0, m_nPerItemHeight); - } - - dc.SelectObject(lpOldPen); -} - -void CAGComboBoxList::OnMouseMove(UINT nFlags, CPoint point) -{ - CRect rcClient; - CRect rcDirty; - int nCurPointIndex = 0; - - GetClientRect(&rcClient); - if (rcClient.PtInRect(point) && m_nItemCount > 0) - nCurPointIndex = point.y / m_nPerItemHeight; - else - nCurPointIndex = -1; - - if (nCurPointIndex != m_nCurPointIndex) { - rcDirty.SetRect(0, nCurPointIndex*m_nPerItemHeight, rcClient.Width(), (nCurPointIndex + 1)*m_nPerItemHeight); - m_nCurPointIndex = nCurPointIndex; - Invalidate(FALSE); - } - - CWnd::OnMouseMove(nFlags, point); -} - -void CAGComboBoxList::OnLButtonDown(UINT nFlags, CPoint point) -{ - CRect rcClient; - SCROLLINFO si; - - memset(&si, 0, sizeof(SCROLLINFO)); - si.cbSize = sizeof(si); - si.fMask = SIF_ALL; - - GetScrollInfo(SB_VERT, &si); - int nStartIndex = si.nPos / m_nPerItemHeight; - - GetClientRect(&rcClient); - if (!rcClient.PtInRect(point)) - m_nCurPointIndex = -1; - else { - if (m_nCurSel != m_nCurPointIndex + nStartIndex) { - m_nCurSel = m_nCurPointIndex + nStartIndex; - m_lpComboBox->GetParent()->SendMessage(WM_COMMAND, MAKEWPARAM(m_lpComboBox->GetDlgCtrlID(), CBN_SELCHANGE), (LPARAM)m_lpComboBox->GetSafeHwnd()); - } - - if (m_nCurSel != -1) { - if (m_nCurSel > (m_nItemCount - 1)) { - m_nCurSel = m_nItemCount - 1; - } - m_lpComboBox->SetWindowText(m_arrItemString.GetAt(m_nCurSel)); - } - } - m_lpComboBox->ShowDropDown(FALSE); - - CWnd::OnLButtonDown(nFlags, point); -} - -BOOL CAGComboBoxList::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt) -{ - // TODO: ڴϢ/Ĭֵ - SCROLLINFO si; - int nVertPos = 0; - - si.cbSize = sizeof(si); - si.fMask = SIF_ALL; - GetScrollInfo(SB_VERT, &si); - nVertPos = si.nPos; - si.nPos -= 2 * zDelta; - si.fMask = SIF_POS; - SetScrollPos(SB_VERT, si.nPos, TRUE); - Invalidate(FALSE); - - return CWnd::OnMouseWheel(nFlags, zDelta, pt); -} - -int CAGComboBoxList::OnCreate(LPCREATESTRUCT lpCreateStruct) -{ - if (CWnd::OnCreate(lpCreateStruct) == -1) - return -1; - - // TODO: ڴרõĴ - ModifyStyleEx(0, WS_EX_TOOLWINDOW); - SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); - - return 0; -} - - -void CAGComboBoxList::OnShowWindow(BOOL bShow, UINT nStatus) -{ - CWnd::OnShowWindow(bShow, nStatus); - - // TODO: ڴ˴Ϣ - if (bShow) - SetCapture(); - else - ReleaseCapture(); - - CWnd::OnShowWindow(bShow, nStatus); -} - -/* -BOOL CAGComboBoxList::OnEraseBkgnd(CDC* pDC) -{ - // TODO: ڴϢ/Ĭֵ - CRect rcClient; - CRect rcBack; - - GetClientRect(&rcClient); - ClientToScreen(&rcClient); - rcBack.CopyRect(&rcClient); - rcBack.left += 1; - rcBack.top += 1; - rcBack.right -= 1; - rcBack.bottom -= 1; - - CPen *lpOldPen = pDC->SelectObject(&m_penBorder); - pDC->Rectangle(&rcClient); - pDC->FillSolidRect(&rcBack, m_crBack); - - pDC->SelectObject(lpOldPen); - - return TRUE; - // return CWnd::OnEraseBkgnd(pDC); -} -*/ - -// CAGComboBox - -IMPLEMENT_DYNAMIC(CAGComboBox, CWnd) - -CAGComboBox::CAGComboBox() -: m_nMaxListHeight(200) -, m_nBtnStat(0) -, m_crBack(RGB(0xF5, 0xF5, 0xF5)) -, m_crBorder(RGB(0xC8, 0xC8, 0xC8)) -, m_crTextNormal(RGB(0x00, 0x00, 0x00)) -, m_crTextHot(RGB(0x00, 0x9E, 0xEB)) -, m_bMouseTrack(FALSE) -, m_lpWndFont(NULL) -{ - m_penBorder.CreatePen(PS_SOLID, 1, RGB(0xC8, 0xC8, 0xC8)); -} - -CAGComboBox::~CAGComboBox() -{ - m_imgDropBtn.DeleteImageList(); - - m_penBorder.DeleteObject(); -} - - -BEGIN_MESSAGE_MAP(CAGComboBox, CWnd) - ON_WM_PAINT() - ON_WM_MOUSEMOVE() - ON_WM_MOUSELEAVE() - ON_WM_LBUTTONDOWN() - ON_WM_ERASEBKGND() -END_MESSAGE_MAP() - - -BOOL CAGComboBox::Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID) -{ - CRect rcListBox; - - rcListBox.left = rect.left; - rcListBox.right = rect.right; - rcListBox.top = rect.bottom + 1; - rcListBox.bottom = rcListBox.top + rect.bottom - rect.top; - - m_ctrList.Create(WS_CHILD | WS_VSCROLL, rcListBox, GetDesktopWindow(), this, nID + 1); - m_ctrList.ShowWindow(SW_HIDE); - - return CWnd::Create(NULL, _T(""), dwStyle, rect, pParentWnd, nID, NULL); -} - -int CAGComboBox::GetCount() const -{ - return m_ctrList.GetCount(); -} - -int CAGComboBox::GetCurSel() const -{ - return m_ctrList.GetCurSel(); -} - -DWORD_PTR CAGComboBox::GetItemData(int nIndex) const -{ - return m_ctrList.GetItemData(nIndex); -} - -void CAGComboBox::GetLBText(int nIndex, CString& rString) const -{ - m_ctrList.GetText(nIndex, rString); -} - -int CAGComboBox::SetItemData(int nIndex, DWORD_PTR dwItemData) -{ - return m_ctrList.SetItemData(nIndex, dwItemData); -} - -void CAGComboBox::ShowDropDown(BOOL bShowIt) -{ - CRect rcClient; - int nItemHeight = m_ctrList.GetItemHeight(); - - GetClientRect(&rcClient); - if (nItemHeight == 0) { - nItemHeight = rcClient.Height(); - m_ctrList.SetItemHeight(nItemHeight); - } - rcClient.OffsetRect(0, rcClient.Height() + 1); - - int nMaxCanvasHeight = m_ctrList.GetCount()*nItemHeight; - m_ctrList.ShowVScrollBar(FALSE); - if (nMaxCanvasHeight == 0) - rcClient.bottom = rcClient.top + m_ctrList.GetItemHeight(); - else if (nMaxCanvasHeight > 0 && nMaxCanvasHeight < m_nMaxListHeight) - rcClient.bottom = rcClient.top + nMaxCanvasHeight; - else{ - rcClient.bottom = rcClient.top + m_nMaxListHeight; - if (nMaxCanvasHeight > m_nMaxListHeight) - m_ctrList.ShowVScrollBar(TRUE); - } - - if (bShowIt) - m_ctrList.ShowWindow(SW_SHOW); - else { - m_ctrList.ShowWindow(SW_HIDE); - Invalidate(TRUE); - } - - ClientToScreen(&rcClient); - m_ctrList.MoveWindow(&rcClient, FALSE); -} - -void CAGComboBox::SetListMaxHeight(int nMaxHeight) -{ - m_nMaxListHeight = nMaxHeight; -} - -int CAGComboBox::AddString(LPCTSTR lpszString) -{ - return m_ctrList.AddString(lpszString); -} - -int CAGComboBox::InsertString(int nIndex, LPCTSTR lpszString) -{ - return m_ctrList.InsertString(nIndex, lpszString); -} - -int CAGComboBox::SetCurSel(int nSelect) -{ - CString str; - int nCurSel = m_ctrList.SetCurSel(nSelect); - - GetLBText(nCurSel, str); - Invalidate(TRUE); - - return nCurSel; -} - -int CAGComboBox::DeleteString(int nIndex) -{ - int nCurSel = m_ctrList.GetCurSel(); - int nCurCount = m_ctrList.DeleteString(nIndex); - - if (nCurSel == nIndex) - Invalidate(TRUE); - - return nCurCount; -} - -void CAGComboBox::ResetContent() -{ - m_ctrList.ResetContent(); - Invalidate(TRUE); -} - -BOOL CAGComboBox::GetDroppedState() const -{ - return m_ctrList.IsWindowVisible(); -} - -int CAGComboBox::GetListMaxHeight() const -{ - return m_nMaxListHeight; -} - -BOOL CAGComboBox::SetButtonImage(UINT nIDButton, int cx, int cy, COLORREF crMask) -{ - CBitmap bmpButton; - - if (!bmpButton.LoadBitmap(nIDButton)) - return FALSE; - - m_imgDropBtn.DeleteImageList(); - m_imgDropBtn.Create(cx, cy, ILC_COLOR24 | ILC_MASK, 4, 1); - m_imgDropBtn.Add(&bmpButton, crMask); - - bmpButton.DeleteObject(); - - Invalidate(FALSE); - - return TRUE; -} - -void CAGComboBox::SetFaceColor(COLORREF crBorder, COLORREF crBack) -{ - m_crBorder = crBorder; - m_crBack = crBack; - - Invalidate(); -} - -void CAGComboBox::SetTextColor(COLORREF crNormal, COLORREF crHot) -{ - m_crTextNormal = crNormal; - m_crTextHot = crHot; -} - -void CAGComboBox::SetFont(CFont* pFont, BOOL bRedraw) -{ - ASSERT(pFont != NULL); - - m_lpWndFont = pFont; - m_ctrList.SetFont(m_lpWndFont, bRedraw); - - Invalidate(bRedraw); -} - -// CAGComboBox Ϣ - -void CAGComboBox::OnPaint() -{ - CPaintDC dc(this); // device context for painting - // TODO: ڴ˴Ϣ - // ΪͼϢ CWnd::OnPaint() - CString str; - CRect rcClient; - CRect rcText; - CPoint ptButton; - IMAGEINFO imgInfo; - CFont *lpOldFont = NULL; - - GetClientRect(&rcClient); - rcText.CopyRect(&rcClient); - rcText.left += 10; - rcText.right -= (rcClient.Height() + 15); - - dc.SetBkMode(TRANSPARENT); - COLORREF crOldColor = dc.SetBkColor(m_crBack); - - if (m_imgDropBtn.GetSafeHandle() != NULL) { - m_imgDropBtn.GetImageInfo(0, &imgInfo); - - int nImageHeight = imgInfo.rcImage.bottom - imgInfo.rcImage.top; - ptButton.x = rcClient.Width() - imgInfo.rcImage.right - 1; - ptButton.y = (rcClient.Height() - nImageHeight) / 2; - m_imgDropBtn.Draw(&dc, m_nBtnStat, ptButton, ILD_NORMAL); - } - - if (m_lpWndFont != NULL) - lpOldFont = dc.SelectObject(m_lpWndFont); - - if (m_nBtnStat == AGCBXBTN_NORMAL || m_nBtnStat == AGCBXBTN_DISABLE) - dc.SetTextColor(m_crTextNormal); - else - dc.SetTextColor(m_crTextHot); - - GetLBText(m_ctrList.GetCurSel(), str); - dc.DrawText(str, &rcText, DT_SINGLELINE | DT_LEFT | DT_VCENTER | DT_END_ELLIPSIS); - - if (lpOldFont != NULL) - dc.SelectObject(lpOldFont); -} - -void CAGComboBox::OnMouseMove(UINT nFlags, CPoint point) -{ - CRect rcClient; - UINT nBtnStat = AGCBXBTN_NORMAL; - - if (!GetDroppedState()) - nBtnStat = AGCBXBTN_HOVER; - - if (m_nBtnStat != nBtnStat) - Invalidate(FALSE); - - m_nBtnStat = nBtnStat; - - if (!m_bMouseTrack) { - - TRACKMOUSEEVENT tmEvent; - - tmEvent.cbSize = sizeof(TRACKMOUSEEVENT); - tmEvent.dwFlags = TME_LEAVE; - tmEvent.hwndTrack = GetSafeHwnd(); - tmEvent.dwFlags = TME_LEAVE; - tmEvent.dwHoverTime = 1; - ::TrackMouseEvent(&tmEvent); - } - - CWnd::OnMouseMove(nFlags, point); -} - -void CAGComboBox::OnMouseLeave() -{ - UINT nBtnStat = AGCBXBTN_NORMAL; - - m_bMouseTrack = FALSE; - if (!GetDroppedState()) - nBtnStat = AGCBXBTN_NORMAL; - - if (m_nBtnStat != nBtnStat) - Invalidate(FALSE); - - m_nBtnStat = nBtnStat; - - CWnd::OnMouseLeave(); -} - -void CAGComboBox::OnLButtonDown(UINT nFlags, CPoint point) -{ - SetFocus(); - - BOOL bDropped = GetDroppedState(); - - if (bDropped) { - m_nBtnStat = AGCBXBTN_NORMAL; - } - else { - m_nBtnStat = AGCBXBTN_PUSH; - } - - ShowDropDown(!bDropped); - - CWnd::OnLButtonDown(nFlags, point); -} - -BOOL CAGComboBox::OnEraseBkgnd(CDC* pDC) -{ - // TODO: ڴϢ/Ĭֵ - CRect rcClient; - CRect rcBack; - - GetClientRect(&rcClient); - rcBack.CopyRect(&rcClient); - rcBack.left += 1; - rcBack.right -= 1; - rcBack.top += 1; - rcBack.bottom -= 1; - - pDC->SetBkMode(TRANSPARENT); - COLORREF crOldColor = pDC->SetBkColor(m_crBack); - - CPen *lpOldPen = pDC->SelectObject(&m_penBorder); - - if ( (GetStyle()&WS_BORDER) != 0) - pDC->Rectangle(&rcClient); - - pDC->FillSolidRect(&rcBack, m_crBack); - - return TRUE; -} - - diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGComboBox.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGComboBox.h deleted file mode 100644 index dd2e6874..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGComboBox.h +++ /dev/null @@ -1,158 +0,0 @@ -#pragma once - -#include - -#define WM_AGCBXNOTIFY_SELCHANGE WM_USER+ - -class CAGComboBox; -// CAGComboBox -class CAGComboBoxList : public CWnd -{ - DECLARE_DYNAMIC(CAGComboBoxList) - -public: - CAGComboBoxList(); - virtual ~CAGComboBoxList(); - - virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, CAGComboBox *pAGComboBox, UINT nID); - - int GetCount() const; - int GetCurSel() const; - DWORD_PTR GetItemData(int nIndex) const; - void GetText(int nIndex, CString& rString) const; - - int SetItemData(int nIndex, DWORD_PTR dwItemData); - int AddString(LPCTSTR lpszString); - int InsertString(int nIndex, LPCTSTR lpszString); - - int SetCurSel(int nSelect); - int DeleteString(int nIndex); - void ResetContent(); - - void SetFont(CFont* pFont, BOOL bRedraw = TRUE); - void SetItemHeight(int nItemHeight); - int GetItemHeight() const; - - void ShowVScrollBar(BOOL bShow); -protected: - afx_msg void OnPaint(); - afx_msg void OnMouseMove(UINT nFlags, CPoint point); - afx_msg void OnLButtonDown(UINT nFlags, CPoint point); - afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt); -// afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); - afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); - afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); -// afx_msg BOOL OnEraseBkgnd(CDC* pDC); - - DECLARE_MESSAGE_MAP() - -protected: - - // the resource to draw the control -private: - CImageList m_imgSel; - CPen m_penBorder; - CFont *m_lpWndFont; - - COLORREF m_crBack; - COLORREF m_crBorder; - COLORREF m_crText; - COLORREF m_crTextHot; - - // the controls -private: - CAGComboBox *m_lpComboBox; - CScrollBar m_ctrVScroll; - - // private data -private: - CStringArray m_arrItemString; - CArray m_arrItemPtrData; - - int m_nItemCount; - int m_nCurSel; - int m_nCurPointIndex; - int m_nPerItemHeight; - -public: - - - -}; - -class CAGComboBox : public CWnd -{ - enum { - AGCBXBTN_NORMAL = 0, - AGCBXBTN_HOVER, - AGCBXBTN_PUSH, - AGCBXBTN_DISABLE, - }; - - DECLARE_DYNAMIC(CAGComboBox) - -public: - CAGComboBox(); - virtual ~CAGComboBox(); - - virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); - - int GetCount() const; - int GetCurSel() const; - DWORD_PTR GetItemData(int nIndex) const; - void GetLBText(int nIndex, CString& rString) const; - - int SetItemData(int nIndex, DWORD_PTR dwItemData); - void ShowDropDown(BOOL bShowIt); - void SetListMaxHeight(int nMaxHeight); - - int AddString(LPCTSTR lpszString); - int InsertString(int nIndex, LPCTSTR lpszString); - - int SetCurSel(int nSelect); - int DeleteString(int nIndex); - void ResetContent(); - - BOOL GetDroppedState() const; - int GetListMaxHeight() const; - - BOOL SetButtonImage(UINT nIDButton, int cx, int cy, COLORREF crMask); - void SetFaceColor(COLORREF crBorder, COLORREF crBack); - void SetTextColor(COLORREF crNormal, COLORREF crHot); - void SetFont(CFont* pFont, BOOL bRedraw = TRUE); - -protected: - afx_msg void OnPaint(); - afx_msg void OnMouseMove(UINT nFlags, CPoint point); - afx_msg void OnMouseLeave(); - afx_msg void OnLButtonDown(UINT nFlags, CPoint point); - afx_msg BOOL OnEraseBkgnd(CDC* pDC); - - DECLARE_MESSAGE_MAP() - -protected: - void OnDrawTextCtrl(CDC *pDC); - void OnDrawBtnCtrl(CDC *pDC); - -private: - CImageList m_imgDropBtn; - CPen m_penBorder; - - COLORREF m_crBack; - COLORREF m_crBorder; - - COLORREF m_crTextNormal; - COLORREF m_crTextHot; - - UINT m_nBtnStat; - int m_nMaxListHeight; - BOOL m_bMouseTrack; - - CFont *m_lpWndFont; - -private: - CAGComboBoxList m_ctrList; - -}; - - diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGConfig.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGConfig.cpp deleted file mode 100644 index 51e6588a..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGConfig.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include "stdafx.h" -#include "AGConfig.h" - - -CAGConfig::CAGConfig() -{ - ::GetModuleFileName(NULL, m_szConfigFile, MAX_PATH); - LPTSTR lpLastSlash = _tcsrchr(m_szConfigFile, _T('\\')) + 1; - _tcscpy_s(lpLastSlash, MAX_PATH, _T("VideoConfig.ini")); - - if (::GetFileAttributes(m_szConfigFile) == INVALID_FILE_ATTRIBUTES){ - HANDLE hFile = ::CreateFile(m_szConfigFile, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - ::CloseHandle(hFile); - } -} - - -CAGConfig::~CAGConfig() -{ -} - -int CAGConfig::GetCodec() -{ -#ifdef ENABLE_CODEC - CString strCodec; - - ::GetPrivateProfileString(_T("VideoConfig"), _T("CodecIndex"), _T("1"), strCodec.GetBuffer(MAX_PATH), MAX_PATH, m_szConfigFile); - - strCodec.ReleaseBuffer(); - - return _ttoi(strCodec); -#else - return 0; -#endif -} - -BOOL CAGConfig::SetCodec(int nCodec) -{ -#ifdef ENABLE_CODEC - CString strCodec; - - strCodec.Format(_T("%d"), nCodec); - - return ::WritePrivateProfileString(_T("VideoConfig"), _T("CodecIndex"), strCodec, m_szConfigFile); -#else - return TRUE; -#endif -} - -/* -int CAGConfig::GetResolution() -{ - CString strResolution; - - ::GetPrivateProfileString(_T("VideoConfig"), _T("ResolutionIndex"), _T("1"), strResolution.GetBuffer(MAX_PATH), MAX_PATH, m_szConfigFile); - - strResolution.ReleaseBuffer(); - - return _ttoi(strResolution); -} - -BOOL CAGConfig::SetResolution(int nResolution) -{ - CString strResolution; - - strResolution.Format(_T("%d"), nResolution); - - return ::WritePrivateProfileString(_T("VideoConfig"), _T("ResolutionIndex"), strResolution, m_szConfigFile); -} - -int CAGConfig::GetFPS() -{ - CString strFps; - - ::GetPrivateProfileString(_T("VideoConfig"), _T("FPSIndex"), _T("1"), strFps.GetBuffer(MAX_PATH), MAX_PATH, m_szConfigFile); - - strFps.ReleaseBuffer(); - - return _ttoi(strFps); -} - -BOOL CAGConfig::SetFPS(int nPFS) -{ - CString strFPS; - - strFPS.Format(_T("%d"), nPFS); - - return ::WritePrivateProfileString(_T("VideoConfig"), _T("FPSIndex"), strFPS, m_szConfigFile); - -} - -int CAGConfig::GetMaxRate() -{ - CString strMaxRate; - - ::GetPrivateProfileString(_T("VideoConfig"), _T("MaxRatePos"), _T("1"), strMaxRate.GetBuffer(MAX_PATH), MAX_PATH, m_szConfigFile); - - strMaxRate.ReleaseBuffer(); - - return _ttoi(strMaxRate); -} - -BOOL CAGConfig::SetMaxRate(int nMaxRate) -{ - CString strMaxRate; - - strMaxRate.Format(_T("%d"), nMaxRate); - - return ::WritePrivateProfileString(_T("VideoConfig"), _T("MaxRatePos"), strMaxRate, m_szConfigFile); -} -*/ - - -int CAGConfig::GetSolution() -{ - CString strResolution; - - ::GetPrivateProfileString(_T("VideoConfig"), _T("SolutionIndex"), _T("1"), strResolution.GetBuffer(MAX_PATH), MAX_PATH, m_szConfigFile); - - strResolution.ReleaseBuffer(); - - return _ttoi(strResolution); -} - -BOOL CAGConfig::SetSolution(int nResolution) -{ - CString strResolution; - - strResolution.Format(_T("%d"), nResolution); - - return ::WritePrivateProfileString(_T("VideoConfig"), _T("SolutionIndex"), strResolution, m_szConfigFile); -} - -BOOL CAGConfig::EnableAutoSave(BOOL bEnable) -{ - CString strSave; - - if (bEnable) - strSave = _T("1"); - else - strSave = _T("0"); - - return ::WritePrivateProfileString(_T("VideoConfig"), _T("SaveSetting"), strSave, m_szConfigFile); -} - -BOOL CAGConfig::IsAutoSaveEnabled() -{ - CString strSaveSetting; - - ::GetPrivateProfileString(_T("VideoConfig"), _T("SaveSetting"), _T("0"), strSaveSetting.GetBuffer(MAX_PATH), MAX_PATH, m_szConfigFile); - - strSaveSetting.ReleaseBuffer(); - - return (_ttoi(strSaveSetting) == 1) ? TRUE : FALSE; -} \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGConfig.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGConfig.h deleted file mode 100644 index 2ccb0d9d..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGConfig.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once -class CAGConfig -{ -public: - CAGConfig(); - ~CAGConfig(); - - int GetCodec(); - BOOL SetCodec(int nCodec); - -/* int GetResolution(); - BOOL SetResolution(int nResolution); - - int GetFPS(); - BOOL SetFPS(int nPFS); - - int GetMaxRate(); - BOOL SetMaxRate(int nMaxRate); -*/ - BOOL EnableAutoSave(BOOL bEnable); - BOOL IsAutoSaveEnabled(); - - BOOL SetSolution(int nIndex); - int GetSolution(); - -private: - TCHAR m_szConfigFile[MAX_PATH]; -}; - diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGDesktopCaptureDlg.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGDesktopCaptureDlg.cpp deleted file mode 100644 index f9d0e387..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGDesktopCaptureDlg.cpp +++ /dev/null @@ -1,229 +0,0 @@ -// AGDesktopCaptureDlg.cpp : ʵļ -// - -#include "stdafx.h" -#include "OpenVideoCall.h" -#include "AGDesktopCaptureDlg.h" -#include "afxdialogex.h" - - -// CAGDesktopCaptureDlg Ի - -IMPLEMENT_DYNAMIC(CAGDesktopCaptureDlg, CDialogEx) - -CAGDesktopCaptureDlg::CAGDesktopCaptureDlg(CWnd* pParent /*=NULL*/) - : CDialogEx(CAGDesktopCaptureDlg::IDD, pParent) - , m_bMouseLDown(FALSE) -{ - -} - -CAGDesktopCaptureDlg::~CAGDesktopCaptureDlg() -{ -} - -void CAGDesktopCaptureDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialogEx::DoDataExchange(pDX); -} - - -BEGIN_MESSAGE_MAP(CAGDesktopCaptureDlg, CDialogEx) - ON_WM_MOUSEMOVE() - ON_WM_LBUTTONDOWN() - ON_WM_LBUTTONUP() - ON_WM_PAINT() - ON_WM_ERASEBKGND() - ON_WM_LBUTTONDBLCLK() - ON_WM_RBUTTONDOWN() -END_MESSAGE_MAP() - - -// CAGDesktopCaptureDlg Ϣ -BOOL CAGDesktopCaptureDlg::SaveScreen(LPCRECT lpRect) -{ - CDC dcDesktop; - CRect rcDesktop; - CRect rcDest; - - CBitmap *lpOldBitmap = NULL; - - CWnd *lpWndDesktop = GetDesktopWindow(); - CDC *lpDCDesktop = lpWndDesktop->GetDC(); - - lpWndDesktop->GetWindowRect(&rcDesktop); - - if (lpRect == NULL) - rcDest.CopyRect(&rcDesktop); - else { - if (lpRect->left < rcDesktop.left || lpRect->top < rcDesktop.top || lpRect->right > rcDesktop.right || lpRect->bottom > rcDesktop.bottom) - return FALSE; - else - rcDest.CopyRect(lpRect); - } - - dcDesktop.CreateCompatibleDC(lpDCDesktop); - - if (m_bmpDesktop.GetSafeHandle() != NULL) - m_bmpDesktop.DeleteObject(); - - m_bmpDesktop.CreateCompatibleBitmap(lpDCDesktop, rcDest.Width(), rcDest.Height()); - lpOldBitmap = dcDesktop.SelectObject(&m_bmpDesktop); - dcDesktop.BitBlt(0, 0, rcDesktop.Width(), rcDesktop.Height(), lpDCDesktop, 0, 0, SRCCOPY); - dcDesktop.SelectObject(lpOldBitmap); - - return TRUE; -} - -void CAGDesktopCaptureDlg::OnPaint() -{ - CPaintDC dc(this); - CDC dcBuffer; - CBitmap bmpBuffer; - // TODO: ڴ˴Ϣ - // ΪͼϢ CWnd::OnPaint() - CRect rcWindow; - BLENDFUNCTION blend; - GetWindowRect(&rcWindow); - - CBrush brBack; - brBack.CreateSolidBrush(RGB(0x00, 0x00, 0x00)); - dcBuffer.CreateCompatibleDC(&dc); - bmpBuffer.CreateCompatibleBitmap(&dc, rcWindow.Width(), rcWindow.Height()); - - CBitmap *lpOldBitmap = dcBuffer.SelectObject(&bmpBuffer); - dcBuffer.FillRect(&rcWindow, &brBack); - - blend.BlendOp = AC_SRC_OVER; - blend.AlphaFormat = 0; - blend.SourceConstantAlpha = 0x80; - blend.BlendFlags = 0; - - dc.AlphaBlend(0, 0, rcWindow.Width(), rcWindow.Height(), &dcBuffer, 0, 0, rcWindow.Width(), rcWindow.Height(), blend); - - if (m_bMouseLDown) { - CDC dcBitmap; - CPen penMark; - CString strTip; - - penMark.CreatePen(PS_SOLID, 4, RGB(0x00, 0xA0, 0xE9)); - - dcBitmap.CreateCompatibleDC(&dc); - dcBitmap.SelectObject(&m_bmpDesktop); - dc.BitBlt(m_rcRegion.left, m_rcRegion.top, m_rcRegion.Width(), m_rcRegion.Height(), &dcBitmap, m_rcRegion.left, m_rcRegion.top, SRCCOPY); - - dc.SelectObject(&penMark); - dc.SelectStockObject(NULL_BRUSH); - dc.Rectangle(&m_rcRegion); - - strTip = _T("double click to share the desktop region or ESC to abort"); - // dc.SetBkMode(TRANSPARENT); - dc.SetBkColor(RGB(0x00, 0xA0, 0xE9)); - dc.SetTextColor(RGB(0xFF, 0xFF, 0xFF)); - dc.TextOut(m_rcRegion.left + 10, m_rcRegion.top + 10, strTip); - } -} - -void CAGDesktopCaptureDlg::OnLButtonDblClk(UINT nFlags, CPoint point) -{ - // TODO: ڴϢ/Ĭֵ - CRect rcRegion; - DESKTOP_SHARE_PARAM deskShareParam; - int nFPS = m_dlgCapSet.GetCaptureFPS(); - m_dlgCapSet.ShowWindow(SW_HIDE); - m_dlgCapSet.GetCaptureRect(&rcRegion); - - deskShareParam.nX = rcRegion.left; - deskShareParam.nY = rcRegion.top; - deskShareParam.nWidth = rcRegion.Width(); - deskShareParam.nHeight = rcRegion.Height(); - deskShareParam.nFPS = m_dlgCapSet.GetCaptureFPS(); - deskShareParam.nBitrate = m_dlgCapSet.GetBitrate(); - - GetParent()->SendMessage(WM_DESKTOPSHARE, (WPARAM)&deskShareParam, NULL); - // CDialogEx::OnLButtonDblClk(nFlags, point); - CDialogEx::OnOK(); -} - -void CAGDesktopCaptureDlg::OnRButtonDown(UINT nFlags, CPoint point) -{ - // TODO: ڴϢ/Ĭֵ - - // CDialogEx::OnRButtonDown(nFlags, point); - m_dlgCapSet.ShowWindow(SW_HIDE); - CDialogEx::OnOK(); -} - -void CAGDesktopCaptureDlg::OnLButtonDown(UINT nFlags, CPoint point) -{ - // TODO: ڴϢ/Ĭֵ - m_bMouseLDown = TRUE; - m_ptStart = point; - - - CDialogEx::OnLButtonDown(nFlags, point); -} - - -void CAGDesktopCaptureDlg::OnLButtonUp(UINT nFlags, CPoint point) -{ - // TODO: ڴϢ/Ĭֵ - m_bMouseLDown = FALSE; - m_ptEnd = point; - - //m_dlgCapSet.MoveWindow(m_rcRegion.left + 10, m_rcRegion.top + 40, 440, 80); - m_dlgCapSet.ShowWindow(SW_SHOW); - - if (m_rcRegion.right == m_rcRegion.left - || m_rcRegion.bottom == m_rcRegion.top){ - return; - } - m_dlgCapSet.SetCaptureRect(&m_rcRegion); - - CDialogEx::OnLButtonUp(nFlags, point); -} - -void CAGDesktopCaptureDlg::OnMouseMove(UINT nFlags, CPoint point) -{ - // TODO: ڴϢ/Ĭֵ - CRect rcMarkWnd; - - if (m_bMouseLDown) { - m_ptEnd = point; - - m_rcRegion.left = m_ptStart.x < m_ptEnd.x ? m_ptStart.x : m_ptEnd.x; - m_rcRegion.top = m_ptStart.y < m_ptEnd.y ? m_ptStart.y : m_ptEnd.y; - - m_rcRegion.right = m_ptStart.x >= m_ptEnd.x ? m_ptStart.x : m_ptEnd.x; - m_rcRegion.bottom = m_ptStart.y >= m_ptEnd.y ? m_ptStart.y : m_ptEnd.y; - - InvalidateRect(&m_rcRegion, FALSE); - } - - CDialogEx::OnMouseMove(nFlags, point); -} -BOOL CAGDesktopCaptureDlg::OnEraseBkgnd(CDC* pDC) -{ - // TODO: ڴϢ/Ĭֵ - CDC dcBuffer; - dcBuffer.CreateCompatibleDC(pDC); - dcBuffer.SelectObject(&m_bmpDesktop); - - CRect rcWindow; - GetWindowRect(&rcWindow); - pDC->BitBlt(0, 0, rcWindow.Width(), rcWindow.Height(), &dcBuffer, 0, 0, SRCCOPY); - - return TRUE; -} - - -BOOL CAGDesktopCaptureDlg::OnInitDialog() -{ - CDialogEx::OnInitDialog(); - - // TODO: ڴӶijʼ - m_dlgCapSet.Create(CDskcapsetDlg::IDD, this); - - return TRUE; // return TRUE unless you set the focus to a control - // 쳣: OCX ҳӦ FALSE -} diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGDesktopCaptureDlg.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGDesktopCaptureDlg.h deleted file mode 100644 index 1812006e..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGDesktopCaptureDlg.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once -#include "DskcapsetDlg.h" - -// CAGDesktopCaptureDlg Ի - -#define WM_DESKTOPSHARE WM_USER+304 - -typedef struct _DESKTOP_SHARE_PARAM -{ - int nX; - int nY; - int nWidth; - int nHeight; - int nFPS; - int nBitrate; - -} DESKTOP_SHARE_PARAM, *PDESKTOP_SHARE_PARAM, *LPDESKTOP_SHARE_PARAM; - -class CAGDesktopCaptureDlg : public CDialogEx -{ - DECLARE_DYNAMIC(CAGDesktopCaptureDlg) - -public: - CAGDesktopCaptureDlg(CWnd* pParent = NULL); // ׼캯 - virtual ~CAGDesktopCaptureDlg(); - - BOOL SaveScreen(LPCRECT lpRect); -// Ի - enum { IDD = IDD_SCRCAP_DIALOG }; - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ - virtual BOOL OnInitDialog(); - - afx_msg void OnMouseMove(UINT nFlags, CPoint point); - afx_msg void OnPaint(); - - afx_msg BOOL OnEraseBkgnd(CDC* pDC); - - afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); - afx_msg void OnRButtonDown(UINT nFlags, CPoint point); - afx_msg void OnLButtonDown(UINT nFlags, CPoint point); - afx_msg void OnLButtonUp(UINT nFlags, CPoint point); - - DECLARE_MESSAGE_MAP() - -private: - CBitmap m_bmpDesktop; - BOOL m_bMouseLDown; - - CPoint m_ptStart; - CPoint m_ptEnd; - CRect m_rcRegion; - -// CComboBox m_cmbFrameRate; - CDskcapsetDlg m_dlgCapSet; -}; diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGEdit.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGEdit.cpp deleted file mode 100644 index a776660f..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGEdit.cpp +++ /dev/null @@ -1,196 +0,0 @@ -// AGEdit.cpp : ʵļ -// - -#include "stdafx.h" -#include "AGEdit.h" - - -// CAGEdit - -IMPLEMENT_DYNAMIC(CAGEdit, CEdit) - -CAGEdit::CAGEdit() -: m_crBorder(RGB(0xD8, 0xD8, 0xD8)) -, m_crBack(RGB(0xFF, 0xFF, 0xFF)) -, m_crText(RGB(0x00, 0xA0, 0xE9)) -, m_crTip(RGB(0xD8, 0xD8, 0xD8)) -, m_strTip(_T("ı")) -, m_bTrackMouseEvent(FALSE) -, m_bOverControl(FALSE) -, m_bEmpty(TRUE) -, m_bTexting(FALSE) -{ - m_penBorder.CreatePen(PS_SOLID, 1, m_crBorder); - m_brushBack.CreateSolidBrush(m_crBack); -} - -CAGEdit::~CAGEdit() -{ - m_penBorder.DeleteObject(); - m_brushBack.DeleteObject(); -} - - -BEGIN_MESSAGE_MAP(CAGEdit, CEdit) - ON_WM_ERASEBKGND() - ON_WM_CTLCOLOR_REFLECT() - ON_WM_MOUSEHOVER() - ON_WM_MOUSEMOVE() - ON_WM_MOUSELEAVE() - ON_WM_SETFOCUS() - ON_WM_KILLFOCUS() - ON_WM_CHAR() - ON_CONTROL_REFLECT(EN_CHANGE, &CAGEdit::OnEnChange) - ON_WM_CREATE() -END_MESSAGE_MAP() - - - -// CAGEdit Ϣ -void CAGEdit::SetTip(LPCTSTR lpTip) -{ - m_strTip = lpTip; - - Invalidate(TRUE); -} - -void CAGEdit::SetColor(COLORREF crBorder, COLORREF crBack, COLORREF crText, COLORREF crTip) -{ - if (crBorder != m_crBorder){ - m_penBorder.DeleteObject(); - m_crBorder = crBorder; - m_penBorder.CreatePen(PS_SOLID, 1, m_crBorder); - } - - if (crBack != m_crBack){ - m_brushBack.DeleteObject(); - m_crBack = crBack; - m_brushBack.CreateSolidBrush(m_crBack); - } - - Invalidate(); -} - -BOOL CAGEdit::OnEraseBkgnd(CDC* pDC) -{ - // TODO: ڴϢ/Ĭֵ - CRect rcWindow; - - GetWindowRect(&rcWindow); - - CPen *lpDefaultPen = pDC->SelectObject(&m_penBorder); - pDC->Rectangle(&rcWindow); - pDC->SelectObject(lpDefaultPen); - - return CEdit::OnEraseBkgnd(pDC); -} - -HBRUSH CAGEdit::CtlColor(CDC* pDC, UINT nCtlColor) -{ - // TODO: ڴ˸ DC κ - pDC->SetBkColor(m_crBack); - - if (m_bEmpty) - pDC->SetTextColor(m_crTip); - else - pDC->SetTextColor(m_crText); - - // TODO: ӦøĴ򷵻ط null - return (HBRUSH)m_brushBack; //༭ɫˢ -} - -void CAGEdit::OnMouseHover(UINT nFlags, CPoint point) -{ - // TODO: ڴϢ/Ĭֵ - - CEdit::OnMouseHover(nFlags, point); -} - - -void CAGEdit::OnMouseMove(UINT nFlags, CPoint point) -{ - // TODO: ڴϢ/Ĭֵ - if (!m_bTrackMouseEvent) { - TRACKMOUSEEVENT TrackMouseEvent; - TrackMouseEvent.cbSize = sizeof(TRACKMOUSEEVENT); - TrackMouseEvent.hwndTrack = GetSafeHwnd(); - TrackMouseEvent.dwFlags = TME_LEAVE | TME_HOVER; - TrackMouseEvent.dwHoverTime = HOVER_DEFAULT; - - m_bTrackMouseEvent = ::TrackMouseEvent(&TrackMouseEvent); - } - - CEdit::OnMouseMove(nFlags, point); -} - - -void CAGEdit::OnMouseLeave() -{ - // TODO: ڴϢ/Ĭֵ - m_bTrackMouseEvent = FALSE; - - CEdit::OnMouseLeave(); -} - - -void CAGEdit::OnSetFocus(CWnd* pOldWnd) -{ - CEdit::OnSetFocus(pOldWnd); - - // TODO: ڴ˴Ϣ - if (m_bEmpty) { - m_bTexting = FALSE; - SetWindowText(_T("")); - } - -} - - -void CAGEdit::OnKillFocus(CWnd* pNewWnd) -{ - CEdit::OnKillFocus(pNewWnd); - - // TODO: ڴ˴Ϣ - m_bTexting = FALSE; - if (m_bEmpty) - SetWindowText(m_strTip); -} - - -void CAGEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) -{ - // TODO: ڴϢ/Ĭֵ - m_bTexting = TRUE; - - if (GetWindowTextLength() <= 2) - Invalidate(); - - CEdit::OnChar(nChar, nRepCnt, nFlags); -} - - -void CAGEdit::OnEnChange() -{ - // TODO: ÿؼ RICHEDIT ؼ - // ʹ֪ͨд CEdit::OnInitDialog() - // CRichEditCtrl().SetEventMask() - // ͬʱ ENM_CHANGE ־㵽С - - // TODO: ڴӿؼ֪ͨ - if (m_bTexting) - m_bEmpty = (GetWindowTextLength() == 0) ? TRUE : FALSE; -} - - -int CAGEdit::OnCreate(LPCREATESTRUCT lpCreateStruct) -{ - if (CEdit::OnCreate(lpCreateStruct) == -1) - return -1; - - // TODO: ڴרõĴ - m_bTexting = FALSE; - if (m_bEmpty) - SetWindowText(m_strTip); - - return 0; -} diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGEdit.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGEdit.h deleted file mode 100644 index 692e7e8a..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGEdit.h +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once - - -// CAGEdit - -class CAGEdit : public CEdit -{ - DECLARE_DYNAMIC(CAGEdit) - -public: - CAGEdit(); - virtual ~CAGEdit(); - - void SetTip(LPCTSTR lpTip); - CString GetTip() { return m_strTip; }; - void SetColor(COLORREF crBorder, COLORREF crBack, COLORREF crText, COLORREF crTip = RGB(0xD8, 0xD8, 0xD8)); - -protected: - afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); - afx_msg BOOL OnEraseBkgnd(CDC* pDC); - afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor); - afx_msg void OnMouseHover(UINT nFlags, CPoint point); - afx_msg void OnMouseMove(UINT nFlags, CPoint point); - afx_msg void OnMouseLeave(); - - afx_msg void OnSetFocus(CWnd* pOldWnd); - afx_msg void OnKillFocus(CWnd* pNewWnd); - - afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); - afx_msg void OnEnChange(); - - DECLARE_MESSAGE_MAP() - -private: - CString m_strTip; - - COLORREF m_crBorder; - COLORREF m_crBack; - COLORREF m_crText; - COLORREF m_crTip; - - CPen m_penBorder; - CBrush m_brushBack; - - BOOL m_bTrackMouseEvent; - BOOL m_bOverControl; - - BOOL m_bEmpty; - BOOL m_bTexting; -}; - - diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGEngineEventHandler.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGEngineEventHandler.cpp deleted file mode 100644 index 0e20334d..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGEngineEventHandler.cpp +++ /dev/null @@ -1,379 +0,0 @@ -#include "StdAfx.h" -#include "AGEngineEventHandler.h" -#include "AGEventDef.h" - -CAGEngineEventHandler::CAGEngineEventHandler(void) -{ -} - -CAGEngineEventHandler::~CAGEngineEventHandler(void) -{ -} - -void CAGEngineEventHandler::SetMsgReceiver(HWND hWnd) -{ - m_hMainWnd = hWnd; -} - -void CAGEngineEventHandler::onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) -{ - LPAGE_JOINCHANNEL_SUCCESS lpData = new AGE_JOINCHANNEL_SUCCESS; - - int nChannelLen = strlen(channel) + 1; - lpData->channel = new char[nChannelLen]; - lpData->uid = uid; - lpData->elapsed = elapsed; - - strcpy_s(lpData->channel, nChannelLen, channel); - - if(m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_JOINCHANNEL_SUCCESS), (WPARAM)lpData, 0); -} - -void CAGEngineEventHandler::onRejoinChannelSuccess(const char* channel, uid_t uid, int elapsed) -{ - LPAGE_REJOINCHANNEL_SUCCESS lpData = new AGE_REJOINCHANNEL_SUCCESS; - - int nChannelLen = strlen(channel) + 1; - lpData->channel = new char[nChannelLen]; - lpData->uid = uid; - lpData->elapsed = elapsed; - - strcpy_s(lpData->channel, nChannelLen, channel); - - if(m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_REJOINCHANNEL_SUCCESS), (WPARAM)lpData, 0); - -} - -void CAGEngineEventHandler::onWarning(int warn, const char* msg) -{ - CString str; - - str = _T("onWarning"); -} - -void CAGEngineEventHandler::onError(int err, const char* msg) -{ - LPAGE_ERROR lpData = new AGE_ERROR; - - int nMsgLen = 0; - - // attention: the pointer of msg maybe NULL!!! - if(msg != NULL) { - nMsgLen = strlen(msg) + 1; - lpData->msg = new char[nMsgLen]; - strcpy_s(lpData->msg, nMsgLen, msg); - } - else - lpData->msg = NULL; - - lpData->err = err; - - - - if(m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_ERROR), (WPARAM)lpData, 0); - -} - -void CAGEngineEventHandler::onAudioQuality(uid_t uid, int quality, unsigned short delay, unsigned short lost) -{ - LPAGE_AUDIO_QUALITY lpData = new AGE_AUDIO_QUALITY; - - lpData->uid = uid; - lpData->quality = quality; - lpData->delay = delay; - lpData->lost = lost; - - if(m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_AUDIO_QUALITY), (WPARAM)lpData, 0); -} - - -void CAGEngineEventHandler::onAudioVolumeIndication(const AudioVolumeInfo* speakers, unsigned int speakerNumber, int totalVolume) -{ - LPAGE_AUDIO_VOLUME_INDICATION lpData = new AGE_AUDIO_VOLUME_INDICATION; - - lpData->speakers = new AudioVolumeInfo[speakerNumber]; - memcpy(lpData->speakers, speakers, speakerNumber*sizeof(AudioVolumeInfo)); - lpData->speakerNumber = speakerNumber; - lpData->totalVolume = totalVolume; - - if (m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_AUDIO_VOLUME_INDICATION), (WPARAM)lpData, 0); - -} - -void CAGEngineEventHandler::onLeaveChannel(const RtcStats& stat) -{ - LPAGE_LEAVE_CHANNEL lpData = new AGE_LEAVE_CHANNEL; - - memcpy(&lpData->rtcStat, &stat, sizeof(RtcStats)); - - if(m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_LEAVE_CHANNEL), (WPARAM)lpData, 0); -} - -void CAGEngineEventHandler::onRtcStats(const RtcStats& stat) -{ - CString str; - - str = _T("stat"); -} - - -void CAGEngineEventHandler::onMediaEngineEvent(int evt) -{ - LPAGE_MEDIA_ENGINE_EVENT lpData = new AGE_MEDIA_ENGINE_EVENT; - - lpData->evt = evt; - - if (m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_MEDIA_ENGINE_EVENT), (WPARAM)lpData, 0); - -} - -void CAGEngineEventHandler::onAudioDeviceStateChanged(const char* deviceId, int deviceType, int deviceState) -{ - LPAGE_AUDIO_DEVICE_STATE_CHANGED lpData = new AGE_AUDIO_DEVICE_STATE_CHANGED; - - int nDeviceIDLen = strlen(deviceId) + 1; - - lpData->deviceId = new char[nDeviceIDLen]; - - strcpy_s(lpData->deviceId, nDeviceIDLen, deviceId); - lpData->deviceType = deviceType; - lpData->deviceState = deviceState; - - if (m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_AUDIO_DEVICE_STATE_CHANGED), (WPARAM)lpData, 0); - -} - -void CAGEngineEventHandler::onVideoDeviceStateChanged(const char* deviceId, int deviceType, int deviceState) -{ - LPAGE_VIDEO_DEVICE_STATE_CHANGED lpData = new AGE_VIDEO_DEVICE_STATE_CHANGED; - - int nDeviceIDLen = strlen(deviceId) + 1; - - lpData->deviceId = new char[nDeviceIDLen]; - - strcpy_s(lpData->deviceId, nDeviceIDLen, deviceId); - lpData->deviceType = deviceType; - lpData->deviceState = deviceState; - - if (m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_VIDEO_DEVICE_STATE_CHANGED), (WPARAM)lpData, 0); - -} - -void CAGEngineEventHandler::onLastmileQuality(int quality) -{ - LPAGE_LASTMILE_QUALITY lpData = new AGE_LASTMILE_QUALITY; - - lpData->quality = quality; - - if(m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_LASTMILE_QUALITY), (WPARAM)lpData, 0); - -} - -void CAGEngineEventHandler::onFirstLocalVideoFrame(int width, int height, int elapsed) -{ - LPAGE_FIRST_LOCAL_VIDEO_FRAME lpData = new AGE_FIRST_LOCAL_VIDEO_FRAME; - - lpData->width = width; - lpData->height = height; - lpData->elapsed = elapsed; - - if(m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_FIRST_LOCAL_VIDEO_FRAME), (WPARAM)lpData, 0); - -} - -void CAGEngineEventHandler::onFirstRemoteVideoDecoded(uid_t uid, int width, int height, int elapsed) -{ - LPAGE_FIRST_REMOTE_VIDEO_DECODED lpData = new AGE_FIRST_REMOTE_VIDEO_DECODED; - - lpData->uid = uid; - lpData->width = width; - lpData->height = height; - lpData->elapsed = elapsed; - - if(m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_FIRST_REMOTE_VIDEO_DECODED), (WPARAM)lpData, 0); - -} - -void CAGEngineEventHandler::onFirstRemoteVideoFrame(uid_t uid, int width, int height, int elapsed) -{ - LPAGE_FIRST_REMOTE_VIDEO_FRAME lpData = new AGE_FIRST_REMOTE_VIDEO_FRAME; - - lpData->uid = uid; - lpData->width = width; - lpData->height = height; - lpData->elapsed = elapsed; - - if(m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_FIRST_REMOTE_VIDEO_FRAME), (WPARAM)lpData, 0); - -} - -void CAGEngineEventHandler::onUserJoined(uid_t uid, int elapsed) -{ - LPAGE_USER_JOINED lpData = new AGE_USER_JOINED; - - lpData->uid = uid; - lpData->elapsed = elapsed; - - if(m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_USER_JOINED), (WPARAM)lpData, 0); -} - -void CAGEngineEventHandler::onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) -{ - LPAGE_USER_OFFLINE lpData = new AGE_USER_OFFLINE; - - lpData->uid = uid; - lpData->reason = reason; - - if(m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_USER_OFFLINE), (WPARAM)lpData, 0); -} - -void CAGEngineEventHandler::onUserMuteAudio(uid_t uid, bool muted) -{ - LPAGE_USER_MUTE_AUDIO lpData = new AGE_USER_MUTE_AUDIO; - - lpData->uid = uid; - lpData->muted = muted; - - if(m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_USER_MUTE_AUDIO), (WPARAM)lpData, 0); - -} - -void CAGEngineEventHandler::onUserMuteVideo(uid_t uid, bool muted) -{ - LPAGE_USER_MUTE_VIDEO lpData = new AGE_USER_MUTE_VIDEO; - - lpData->uid = uid; - lpData->muted = muted; - - if(m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_USER_MUTE_VIDEO), (WPARAM)lpData, 0); - -} - -void CAGEngineEventHandler::onStreamMessage(uid_t uid, int streamId, const char* data, size_t length) -{ - LPAGE_STREAM_MESSAGE lpData = new AGE_STREAM_MESSAGE; - - lpData->uid = uid; - lpData->streamId = streamId; - lpData->data = new char[length]; - lpData->length = length; - - memcpy_s(lpData->data, length, data, length); - - if (m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_STREAM_MESSAGE), (WPARAM)lpData, 0); - -} - -void CAGEngineEventHandler::onApiCallExecuted(const char* api, int error) -{ - LPAGE_APICALL_EXECUTED lpData = new AGE_APICALL_EXECUTED; - - strcpy_s(lpData->api, 128, api); - lpData->error = error; - - if (m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_APICALL_EXECUTED), (WPARAM)lpData, 0); -} - -void CAGEngineEventHandler::onLocalVideoStats(const LocalVideoStats& stats) -{ - LPAGE_LOCAL_VIDEO_STAT lpData = new AGE_LOCAL_VIDEO_STAT; - - lpData->sentBitrate = stats.sentBitrate; - lpData->sentFrameRate = stats.sentFrameRate; - - if(m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_LOCAL_VIDEO_STAT), (WPARAM)lpData, 0); - -} - -void CAGEngineEventHandler::onRemoteVideoStats(const RemoteVideoStats& stats) -{ - LPAGE_REMOTE_VIDEO_STAT lpData = new AGE_REMOTE_VIDEO_STAT; - - lpData->uid = stats.uid; - lpData->delay = stats.delay; - lpData->width = stats.width; - lpData->height = stats.height; - lpData->rendererOutputFrameRate = stats.rendererOutputFrameRate; - lpData->receivedBitrate = stats.receivedBitrate; - lpData->decoderOutputFrameRate = stats.decoderOutputFrameRate; - - if(m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_REMOTE_VIDEO_STAT), (WPARAM)lpData, 0); -} - -void CAGEngineEventHandler::onCameraReady() -{ - if(m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_CAMERA_READY), 0, 0); - -} - -void CAGEngineEventHandler::onVideoStopped() -{ - if (m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_VIDEO_STOPPED), 0, 0); -} - -void CAGEngineEventHandler::onConnectionLost() -{ - if(m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_CONNECTION_LOST), 0, 0); -} - -void CAGEngineEventHandler::onConnectionInterrupted() -{ - CString str; - - str = _T("onConnectionInterrupted"); -} - -void CAGEngineEventHandler::onUserEnableVideo(uid_t uid, bool enabled) -{ -// if (m_hMainWnd != NULL) -// ::PostMessage(m_hMainWnd, WM_MSGID(EID_CONNECTION_LOST), 0, 0); - -} - -void CAGEngineEventHandler::onStartRecordingService(int error) -{ - if (m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_START_RCDSRV), 0, 0); - -} - -void CAGEngineEventHandler::onStopRecordingService(int error) -{ - if (m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_STOP_RCDSRV), 0, 0); - -} - -void CAGEngineEventHandler::onRefreshRecordingServiceStatus(int status) -{ - LPAGE_RCDSRV_STATUS lpData = new AGE_RCDSRV_STATUS; - - lpData->status = status; - - if (m_hMainWnd != NULL) - ::PostMessage(m_hMainWnd, WM_MSGID(EID_REFREASH_RCDSRV), (WPARAM)lpData, 0); -} \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGEngineEventHandler.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGEngineEventHandler.h deleted file mode 100644 index 821599b5..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGEngineEventHandler.h +++ /dev/null @@ -1,55 +0,0 @@ -#pragma once - -using namespace agora::rtc; - -class CAGEngineEventHandler : - public IRtcEngineEventHandler -{ -public: - CAGEngineEventHandler(void); - ~CAGEngineEventHandler(void); - - void SetMsgReceiver(HWND hWnd = NULL); - HWND GetMsgReceiver() {return m_hMainWnd;}; - - virtual void onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed); - virtual void onRejoinChannelSuccess(const char* channel, uid_t uid, int elapsed); - virtual void onWarning(int warn, const char* msg); - virtual void onError(int err, const char* msg); - virtual void onAudioQuality(uid_t uid, int quality, unsigned short delay, unsigned short lost); - virtual void onAudioVolumeIndication(const AudioVolumeInfo* speakers, unsigned int speakerNumber, int totalVolume); - - virtual void onLeaveChannel(const RtcStats& stat); - virtual void onRtcStats(const RtcStats& stat); - virtual void onMediaEngineEvent(int evt); - - virtual void onAudioDeviceStateChanged(const char* deviceId, int deviceType, int deviceState); - virtual void onVideoDeviceStateChanged(const char* deviceId, int deviceType, int deviceState); - - virtual void onLastmileQuality(int quality); - virtual void onFirstLocalVideoFrame(int width, int height, int elapsed); - virtual void onFirstRemoteVideoDecoded(uid_t uid, int width, int height, int elapsed); - virtual void onFirstRemoteVideoFrame(uid_t uid, int width, int height, int elapsed); - virtual void onUserJoined(uid_t uid, int elapsed); - virtual void onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason); - virtual void onUserMuteAudio(uid_t uid, bool muted); - virtual void onUserMuteVideo(uid_t uid, bool muted); - virtual void onApiCallExecuted(const char* api, int error); - - virtual void onStreamMessage(uid_t uid, int streamId, const char* data, size_t length); - - virtual void onLocalVideoStats(const LocalVideoStats& stats); - virtual void onRemoteVideoStats(const RemoteVideoStats& stats); - virtual void onCameraReady(); - virtual void onVideoStopped(); - virtual void onConnectionLost(); - virtual void onConnectionInterrupted(); - - virtual void onUserEnableVideo(uid_t uid, bool enabled); - - virtual void onStartRecordingService(int error); - virtual void onStopRecordingService(int error); - virtual void onRefreshRecordingServiceStatus(int status); -private: - HWND m_hMainWnd; -}; diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGEventDef.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGEventDef.h deleted file mode 100644 index 5b88bae5..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGEventDef.h +++ /dev/null @@ -1,255 +0,0 @@ -#ifndef _AG_EVENT_DEFINE_H_ -#define _AG_EVENT_DEFINE_H_ - -#define WM_MSGID(code) (WM_USER+0x200+code) -#define WM_EVTID(code) (code-0x200-WM_USER) - -typedef struct _AGE_JOINCHANNEL_SUCCESS -{ - char *channel; - uid_t uid; - int elapsed; - -} AGE_JOINCHANNEL_SUCCESS, *PAGE_JOINCHANNEL_SUCCESS, *LPAGE_JOINCHANNEL_SUCCESS; - -#define EID_JOINCHANNEL_SUCCESS 0x00000001 - -typedef AGE_JOINCHANNEL_SUCCESS AGE_REJOINCHANNEL_SUCCESS, *PAGE_REJOINCHANNEL_SUCCESS, *LPAGE_REJOINCHANNEL_SUCCESS ; - -#define EID_REJOINCHANNEL_SUCCESS 0x00000002 - -typedef struct _AGE_ERROR -{ - int err; - char *msg; - -} AGE_ERROR, *PAGE_ERROR, *LPAGE_ERROR; - -#define EID_ERROR 0x00000003 - -typedef struct _AGE_AUDIO_QUALITY { - uid_t uid; - int quality; - unsigned short delay; - unsigned short lost; - -} AGE_AUDIO_QUALITY, *PAGE_AUDIO_QUALITY, *LPAGE_AUDIO_QUALITY; - -#define EID_AUDIO_QUALITY 0x00000004 - -typedef struct _AGE_AUDIO_TRANSPORT_QUALITY -{ - uid_t uid; - unsigned short delay; - unsigned short lost; - -} AGE_AUDIO_TRANSPORT_QUALITY, *PAGE_AUDIO_TRANSPORT_QUALITY, *LPAGE_AUDIO_TRANSPORT_QUALITY; - -#define EID_AUDIO_TRANSPORT_QUALITY 0x00000005 - -typedef AGE_AUDIO_TRANSPORT_QUALITY AGE_VIDEO_TRANSPORT_QUALITY, *PAGE_VIDEO_TRANSPORT_QUALITY, *LPAGE_VIDEO_TRANSPORT_QUALITY; - -#define EID_VUDIO_TRANSPORT_QUALITY 0x00000006 - -typedef struct _AGE_RECAP -{ - char* recapData; - int length; - -} AGE_RECAP, *PAGE_RECAP, *LPAGE_RECAP; - -#define EID_RECAP 0x00000007 - -typedef struct _AGE_AUDIO_VOLUME_INDICATION -{ - AudioVolumeInfo *speakers; - unsigned int speakerNumber; - int totalVolume; - -} AGE_AUDIO_VOLUME_INDICATION, *PAGE_AUDIO_VOLUME_INDICATION, *LPAGE_AUDIO_VOLUME_INDICATION; - -#define EID_AUDIO_VOLUME_INDICATION 0x00000008 - -typedef struct _AGE_LEAVE_CHANNEL -{ - RtcStats rtcStat; - -} AGE_LEAVE_CHANNEL, *PAGE_LEAVE_CHANNEL, *LPAGE_LEAVE_CHANNEL; - -#define EID_LEAVE_CHANNEL 0x00000009 - -typedef AGE_LEAVE_CHANNEL AGE_UPDATE_SESSION_STATS, *PAGE_UPDATE_SESSION_STATS, *LPAGE_UPDATE_SESSION_STATS; - -#define EID_UPDATE_SESSION_STATS 0x0000000A - -typedef struct _AGE_MEDIA_ENGINE_EVENT -{ - int evt; - -} AGE_MEDIA_ENGINE_EVENT, *PAGE_MEDIA_ENGINE_EVENT, *LPAGE_MEDIA_ENGINE_EVENT; - -#define EID_MEDIA_ENGINE_EVENT 0x0000000B - -typedef struct _AGE_AUDIO_DEVICE_STATE_CHANGED -{ - char *deviceId; - int deviceType; - int deviceState; - -} AGE_AUDIO_DEVICE_STATE_CHANGED, *PAGE_AUDIO_DEVICE_STATE_CHANGED, *LPAGE_AUDIO_DEVICE_STATE_CHANGED; - -#define EID_AUDIO_DEVICE_STATE_CHANGED 0x0000000C - - -typedef struct _AGE_LASTMILE_QUALITY -{ - int quality; - -} AGE_LASTMILE_QUALITY, *PAGE_LASTMILE_QUALITY, *LPAGE_LASTMILE_QUALITY; - -#define EID_LASTMILE_QUALITY 0x0000000D - -typedef struct _AGE_FIRST_LOCAL_VIDEO_FRAME -{ - int width; - int height; - int elapsed; - -} AGE_FIRST_LOCAL_VIDEO_FRAME, *PAGE_FIRST_LOCAL_VIDEO_FRAME, *LPAGE_FIRST_LOCAL_VIDEO_FRAME; - -#define EID_FIRST_LOCAL_VIDEO_FRAME 0x0000000E - -typedef struct _AGE_FIRST_REMOTE_VIDEO_DECODED -{ - uid_t uid; - int width; - int height; - int elapsed; - -} AGE_FIRST_REMOTE_VIDEO_DECODED, *PAGE_FIRST_REMOTE_VIDEO_DECODED, *LPAGE_FIRST_REMOTE_VIDEO_DECODED; - -#define EID_FIRST_REMOTE_VIDEO_DECODED 0x0000000F - -typedef AGE_FIRST_REMOTE_VIDEO_DECODED AGE_FIRST_REMOTE_VIDEO_FRAME, *PAGE_FIRST_REMOTE_VIDEO_FRAME, *LPAGE_FIRST_REMOTE_VIDEO_FRAME; - -#define EID_FIRST_REMOTE_VIDEO_FRAME 0x00000010 - -typedef struct _AGE_USER_JOINED -{ - uid_t uid; - int elapsed; - -} AGE_USER_JOINED, *PAGE_USER_JOINED, *LPAGE_USER_JOINED; - -#define EID_USER_JOINED 0x00000011 - -typedef struct _AGE_USER_OFFLINE -{ - uid_t uid; - USER_OFFLINE_REASON_TYPE reason; - -} AGE_USER_OFFLINE, *PAGE_USER_OFFLINE, *LPAGE_USER_OFFLINE; - -#define EID_USER_OFFLINE 0x00000012 - -typedef struct _AGE_USER_MUTE_AUDIO -{ - uid_t uid; - bool muted; - -} AGE_USER_MUTE_AUDIO, *PAGE_USER_MUTE_AUDIO, *LPAGE_USER_MUTE_AUDIO; - -#define EID_USER_MUTE_AUDIO 0x00000013 - -typedef AGE_USER_MUTE_AUDIO AGE_USER_MUTE_VIDEO, *PAGE_USER_MUTE_VIDEO, *LPAGE_USER_MUTE_VIDEO; - -#define EID_USER_MUTE_VIDEO 0x00000014 - -typedef struct _AGE_AUDIO_RECORDER_EXCEPTION -{ - int elapsed; - -} AGE_AUDIO_RECORDER_EXCEPTION, *PAGE_AUDIO_RECORDER_EXCEPTION, *LPAGE_AUDIO_RECORDER_EXCEPTION; - -#define EID_AUDIO_RECORDER_EXCEPTION 0x00000015 - -typedef struct _AGE_LOCAL_VIDEO_STAT -{ - int sentBitrate; - int sentFrameRate; - -} AGE_LOCAL_VIDEO_STAT, *PAGE_LOCAL_VIDEO_STAT, *LPAGE_LOCAL_VIDEO_STAT; - -#define EID_LOCAL_VIDEO_STAT 0x00000016 - -typedef struct _AGE_REMOTE_VIDEO_STAT -{ - uid_t uid; - int delay; - int width; - int height; - int receivedBitrate; - int decoderOutputFrameRate; - int rendererOutputFrameRate; - -} AGE_REMOTE_VIDEO_STAT, *PAGE_REMOTE_VIDEO_STAT, *LPAGE_REMOTE_VIDEO_STAT; - -#define EID_REMOTE_VIDEO_STAT 0x00000017 - -#define EID_CAMERA_READY 0x00000018 -#define EID_CONNECTION_LOST 0x00000019 - -#define EID_VENDOR_MESSAGE 0x0000001A -typedef struct _AGE_VENDOR_MESSAGE -{ - uid_t uid; - char* data; - size_t length; - -} AGE_VENDOR_MESSAGE, *PAGE_VENDOR_MESSAGE, *LPAGE_VENDOR_MESSAGE; - - -typedef struct _AGE_VIDEO_DEVICE_STATE_CHANGED -{ - char *deviceId; - int deviceType; - int deviceState; - -} AGE_VIDEO_DEVICE_STATE_CHANGED, *PAGE_VIDEO_DEVICE_STATE_CHANGED, *LPAGE_VIDEO_DEVICE_STATE_CHANGED; - -#define EID_VIDEO_DEVICE_STATE_CHANGED 0x0000001B - -#define EID_VIDEO_STOPPED 0x0000001C - -#define EID_START_RCDSRV 0x0000001D -#define EID_STOP_RCDSRV 0x0000001E - -typedef struct _AGE_RCDSRV_STATUS -{ - int status; - -}AGE_RCDSRV_STATUS, *PAGE_RCDSRV_STATUS, *LPAGE_RCDSRV_STATUS; - -#define EID_REFREASH_RCDSRV 0x0000001F - -typedef struct _AGE_APICALL_EXECUTED -{ - char api[128]; - int error; - -}AGE_APICALL_EXECUTED, *PAGE_APICALL_EXECUTED, *LPAGE_APICALL_EXECUTED; - -#define EID_APICALL_EXECUTED 0x00000020 - -typedef struct _AGE_STREAM_MESSAGE -{ - uid_t uid; - int streamId; - char *data; - size_t length; - -} AGE_STREAM_MESSAGE, *PAGE_STREAM_MESSAGE, *LPAGE_STREAM_MESSAGE; - -#define EID_STREAM_MESSAGE 0x00000021 - -#endif \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGHyperLink.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGHyperLink.cpp deleted file mode 100644 index 9d3a6e32..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGHyperLink.cpp +++ /dev/null @@ -1,177 +0,0 @@ -// AGHyperLink.cpp : ʵļ -// - -#include "stdafx.h" -#include "AGHyperLink.h" - - -// CAGHyperLink - -IMPLEMENT_DYNAMIC(CAGHyperLink, CStatic) - -CAGHyperLink::CAGHyperLink() -{ - m_crLink = RGB(0x00, 0x9E, 0xEB); - m_crVisited = RGB(85, 26, 139); - m_crHover = RGB(255, 0, 0); - m_crBack = RGB(255, 255, 255); - m_bVisited = FALSE; // Hasn't been visited yet. - m_bOverControl = FALSE; - m_bTrackMouseEvent = FALSE; - m_strURL.Empty(); -} - -CAGHyperLink::~CAGHyperLink() -{ -} - - -BEGIN_MESSAGE_MAP(CAGHyperLink, CStatic) - ON_WM_MOUSEMOVE() - ON_WM_SETCURSOR() - ON_CONTROL_REFLECT(STN_CLICKED, &CAGHyperLink::OnStnClicked) - ON_WM_PAINT() - ON_WM_MOUSELEAVE() -END_MESSAGE_MAP() - -// CAGHyperLink Ϣ -void CAGHyperLink::PreSubclassWindow() -{ - // We want to get mouse clicks via STN_CLICKED - DWORD dwStyle = GetStyle(); - ModifyStyle(0, SS_NOTIFY, 0); - - // Set the URL as the window text - if (m_strURL.IsEmpty()) - GetWindowText(m_strURL); - - // Check that the window text isn't empty. If it is, set it as the URL. - CString strWndText; - GetWindowText(strWndText); - if (strWndText.IsEmpty()) - { - ASSERT(!m_strURL.IsEmpty()); // Window and URL both NULL. DUH! - SetWindowText(m_strURL); - } - - CStatic::PreSubclassWindow(); -} - -void CAGHyperLink::OnMouseMove(UINT nFlags, CPoint point) -{ - // TODO: ڴϢ/Ĭֵ - if (!m_bOverControl){ - m_bOverControl = TRUE; - Invalidate(FALSE); - } - - if (!m_bTrackMouseEvent) { - TRACKMOUSEEVENT TrackMouseEvent; - TrackMouseEvent.cbSize = sizeof(TRACKMOUSEEVENT); - TrackMouseEvent.hwndTrack = GetSafeHwnd(); - TrackMouseEvent.dwFlags = TME_LEAVE; - TrackMouseEvent.dwHoverTime = 1; - - m_bTrackMouseEvent = ::TrackMouseEvent(&TrackMouseEvent); - } - - CStatic::OnMouseMove(nFlags, point); -} - -BOOL CAGHyperLink::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) -{ - // TODO: ڴϢ/Ĭֵ - HCURSOR hLinkCursor = ::LoadCursor(NULL, IDC_HAND); - if (hLinkCursor != NULL) { - ::SetCursor(hLinkCursor); - return TRUE; - } - - return CStatic::OnSetCursor(pWnd, nHitTest, message); -} - - -void CAGHyperLink::OnStnClicked() -{ - // TODO: ڴӿؼ֪ͨ - m_bOverControl = FALSE; - - HINSTANCE hInstance = ::ShellExecute(GetParent()->GetSafeHwnd(), _T("open"), m_strURL, NULL, NULL, SW_MAXIMIZE); - if (hInstance > 0) - m_bVisited = TRUE; -} - -void CAGHyperLink::SetURL(CString strURL) -{ - m_strURL = strURL; -} - -CString CAGHyperLink::GetURL() const -{ - return m_strURL; -} - -void CAGHyperLink::SetTextColor(COLORREF crLink, COLORREF crVisited, COLORREF crHover) -{ - m_crLink = crLink; - m_crVisited = crVisited; - m_crHover = crHover; - - if(GetSafeHwnd() != NULL) - Invalidate(); -} - -void CAGHyperLink::SetBackColor(COLORREF crBack) -{ - m_crBack = crBack; -} - -COLORREF CAGHyperLink::GetLinkColor() const -{ - return m_crLink; -} - -COLORREF CAGHyperLink::GetVisitedColor() const -{ - return m_crVisited; -} - -COLORREF CAGHyperLink::GetHoverColor() const -{ - return m_crHover; -} - - -void CAGHyperLink::OnPaint() -{ - CPaintDC dc(this); // device context for painting - // TODO: ڴ˴Ϣ - // ΪͼϢ CStatic::OnPaint() - - CString strWindowText; - CRect rcClient; - - GetClientRect(&rcClient); - - CFont *lpDefaultFont = dc.SelectObject(GetFont()); - dc.SetTextColor(m_crLink); - dc.SetBkColor(m_crBack); - if (m_bOverControl) - dc.SetTextColor(m_crHover); - else if (m_bVisited) - dc.SetTextColor(m_crVisited); - - GetWindowText(strWindowText); - dc.DrawText(strWindowText, &rcClient, DT_LEFT); - dc.SelectObject(lpDefaultFont); -} - -void CAGHyperLink::OnMouseLeave() -{ - // TODO: ڴϢ/Ĭֵ - m_bTrackMouseEvent = FALSE; - m_bOverControl = FALSE; - Invalidate(FALSE); - - CStatic::OnMouseLeave(); -} diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGHyperLink.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGHyperLink.h deleted file mode 100644 index 8b8777a2..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGHyperLink.h +++ /dev/null @@ -1,45 +0,0 @@ -#pragma once - - -// CAGHyperLink - -class CAGHyperLink : public CStatic -{ - DECLARE_DYNAMIC(CAGHyperLink) - -public: - CAGHyperLink(); - virtual ~CAGHyperLink(); - - void SetURL(CString strURL); - CString GetURL() const; - - void SetTextColor(COLORREF crLink, COLORREF crVisited, COLORREF crHover); - void SetBackColor(COLORREF crBack); - COLORREF GetLinkColor() const; - COLORREF GetVisitedColor() const; - COLORREF GetHoverColor() const; - -protected: - virtual void PreSubclassWindow(); - - afx_msg void OnPaint(); - afx_msg void OnMouseMove(UINT nFlags, CPoint point); - afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); - afx_msg void OnStnClicked(); - afx_msg void OnMouseLeave(); - - DECLARE_MESSAGE_MAP() - -private: - COLORREF m_crLink; - COLORREF m_crVisited; // Hyperlink colours - COLORREF m_crHover; // Hover colour - COLORREF m_crBack; - BOOL m_bOverControl; - BOOL m_bVisited; // Has it been visited? - BOOL m_bTrackMouseEvent; - CString m_strURL; // hyperlink URL -}; - - diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGLinkCtrl.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGLinkCtrl.cpp deleted file mode 100644 index b62c215d..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGLinkCtrl.cpp +++ /dev/null @@ -1,137 +0,0 @@ -// AGLinkCtrl.cpp : ʵļ -// - -#include "stdafx.h" -#include "OpenVideoCall.h" -#include "AGLinkCtrl.h" - - -// CAGLinkCtrl - -IMPLEMENT_DYNAMIC(CAGLinkCtrl, CStatic) - -CAGLinkCtrl::CAGLinkCtrl() -: m_crText(RGB(0x00, 0x9E, 0xEB)) -, m_crHover(RGB(0x00, 0xA0, 0xE9)) -, m_crBack(RGB(0xFF, 0xFF, 0xFF)) -, m_bOverControl(FALSE) -, m_bTrackMouseEvent(FALSE) -{ - -} - -CAGLinkCtrl::~CAGLinkCtrl() -{ - -} - - -BEGIN_MESSAGE_MAP(CAGLinkCtrl, CStatic) - ON_WM_MOUSEMOVE() - ON_WM_SETCURSOR() - ON_WM_PAINT() - ON_WM_MOUSELEAVE() -END_MESSAGE_MAP() - - - -// CAGLinkCtrl Ϣ - -void CAGLinkCtrl::PreSubclassWindow() -{ - // We want to get mouse clicks via STN_CLICKED - DWORD dwStyle = GetStyle(); - ModifyStyle(0, SS_NOTIFY, 0); - - // Check that the window text isn't empty. If it is, set it as the URL. - - CStatic::PreSubclassWindow(); -} - - -void CAGLinkCtrl::OnMouseMove(UINT nFlags, CPoint point) -{ - // TODO: ڴϢ/Ĭֵ - if (!m_bOverControl){ - m_bOverControl = TRUE; - Invalidate(FALSE); - } - - if (!m_bTrackMouseEvent) { - TRACKMOUSEEVENT TrackMouseEvent; - TrackMouseEvent.cbSize = sizeof(TRACKMOUSEEVENT); - TrackMouseEvent.hwndTrack = GetSafeHwnd(); - TrackMouseEvent.dwFlags = TME_LEAVE; - TrackMouseEvent.dwHoverTime = HOVER_DEFAULT; - - m_bTrackMouseEvent = ::TrackMouseEvent(&TrackMouseEvent); - } - - CStatic::OnMouseMove(nFlags, point); -} - -void CAGLinkCtrl::OnPaint() -{ - CPaintDC dc(this); // device context for painting - // TODO: ڴ˴Ϣ - // ΪͼϢ CLinkCtrl::OnPaint() - - CString strWindowText; - CRect rcClient; - - GetClientRect(&rcClient); - - CFont *lpDefaultFont = dc.SelectObject(GetFont()); - dc.SetTextColor(m_crText); - dc.SetBkColor(m_crBack); - if (m_bOverControl) - dc.SetTextColor(m_crHover); - - GetWindowText(strWindowText); - dc.DrawText(strWindowText, &rcClient, DT_LEFT); - dc.SelectObject(lpDefaultFont); -} - - -BOOL CAGLinkCtrl::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) -{ - // TODO: ڴϢ/Ĭֵ - HCURSOR hLinkCursor = ::LoadCursor(NULL, IDC_HAND); - if (hLinkCursor != NULL) { - ::SetCursor(hLinkCursor); - return TRUE; - } - - return CStatic::OnSetCursor(pWnd, nHitTest, message); -} - -void CAGLinkCtrl::OnMouseLeave() -{ - // TODO: ڴϢ/Ĭֵ - m_bTrackMouseEvent = FALSE; - m_bOverControl = FALSE; - Invalidate(FALSE); - - CStatic::OnMouseLeave(); -} - -void CAGLinkCtrl::SetTextColor(COLORREF crText, COLORREF crHover) -{ - m_crText = crText; - m_crHover = crHover; -} - -void CAGLinkCtrl::SetBackColor(COLORREF crBack) -{ - m_crBack = crBack; -} - -COLORREF CAGLinkCtrl::GetTextColor() const -{ - return m_crText; -} - -COLORREF CAGLinkCtrl::GetHoverColor() const -{ - return m_crHover; -} \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGLinkCtrl.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGLinkCtrl.h deleted file mode 100644 index ae7a056d..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGLinkCtrl.h +++ /dev/null @@ -1,35 +0,0 @@ -#pragma once -#include - -// CAGLinkCtrl - -class CAGLinkCtrl : public CStatic -{ - DECLARE_DYNAMIC(CAGLinkCtrl) - -public: - CAGLinkCtrl(); - virtual ~CAGLinkCtrl(); - - void SetTextColor(COLORREF crText, COLORREF crHover); - void SetBackColor(COLORREF crBack); - COLORREF GetTextColor() const; - COLORREF GetHoverColor() const; - -protected: - virtual void PreSubclassWindow(); - - afx_msg void OnPaint(); - afx_msg void OnMouseMove(UINT nFlags, CPoint point); - afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); - afx_msg void OnMouseLeave(); - - DECLARE_MESSAGE_MAP() - -private: - COLORREF m_crText; - COLORREF m_crHover; // Hover colour - COLORREF m_crBack; - BOOL m_bOverControl; - BOOL m_bTrackMouseEvent; -}; \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGMessage.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGMessage.h deleted file mode 100644 index 8d5c5875..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGMessage.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#define WM_GOBACK WM_USER+100 -#define WM_GONEXT WM_USER+101 -#define WM_JOINCHANNEL WM_USER+200 -#define WM_LEAVECHANNEL WM_USER+201 - - -#define WM_AGSLD_TMBPOSCHANGED WM_USER+200 \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGResourceVisitor.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGResourceVisitor.cpp deleted file mode 100644 index 201cecb0..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGResourceVisitor.cpp +++ /dev/null @@ -1,81 +0,0 @@ -#include "StdAfx.h" -#include "AGResourceVisitor.h" - -CAGResourceVisitor::CAGResourceVisitor(void) -{ -} - -CAGResourceVisitor::~CAGResourceVisitor(void) -{ -} - -BOOL PASCAL CAGResourceVisitor::SaveResourceToFile(LPCTSTR lpResourceType, WORD wResourceID, LPCTSTR lpFilePath) -{ - HMODULE hModule = ::GetModuleHandle(NULL); - - if(hModule == NULL) - return FALSE; - - HRSRC hResrc = ::FindResource(hModule, MAKEINTRESOURCE(wResourceID), lpResourceType); - if( hResrc == NULL) - return FALSE; - - HGLOBAL hGlobal = ::LoadResource(hModule, hResrc); - if( hGlobal == NULL ) - return FALSE; - - LPBYTE lpPointer = (LPBYTE)::LockResource( hGlobal ); - DWORD dwResSize = ::SizeofResource(hModule, hResrc); - - HANDLE hFile = ::CreateFile(lpFilePath, GENERIC_ALL, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - if(hFile == INVALID_HANDLE_VALUE) - return FALSE; - - DWORD dwBytesWritten = 0; - ::WriteFile(hFile, lpPointer, dwResSize, &dwBytesWritten, NULL); - ::CloseHandle(hFile); - - return (dwBytesWritten == dwResSize) ? TRUE:FALSE; -} - -LPCSTR PASCAL CAGResourceVisitor::TransWinPathA(LPCSTR lpWinPath, LPSTR lpStandardPath, SIZE_T cchSize) -{ - int nPathLen = strlen(lpWinPath) + 1; - if(cchSize < nPathLen) - return NULL; - - CHAR szASIN[MAX_PATH]; - WCHAR szUnicode[MAX_PATH]; - - memset(szASIN, 0, MAX_PATH); - - for(int nIndex = 0; nIndex < nPathLen; nIndex++){ - - if(lpWinPath[nIndex] != '\\') - szASIN[nIndex] = lpWinPath[nIndex]; - else - szASIN[nIndex] = '/'; - } - - ::MultiByteToWideChar(CP_ACP, 0, szASIN, -1, szUnicode, MAX_PATH); - ::WideCharToMultiByte(CP_UTF8, 0, szUnicode, -1, lpStandardPath, cchSize, NULL, NULL); - return lpStandardPath; -} - -LPCWSTR PASCAL CAGResourceVisitor::TransWinPathW(LPCWSTR lpWinPath, LPWSTR lpStandardPath, SIZE_T cchSize) -{ - int nPathLen = wcslen(lpWinPath) + 1; - - if(cchSize < nPathLen) - return NULL; - - for(int nIndex = 0; nIndex < nPathLen; nIndex++){ - - if(lpWinPath[nIndex] != L'\\') - lpStandardPath[nIndex] = lpWinPath[nIndex]; - else - lpStandardPath[nIndex] = L'/'; - } - - return lpStandardPath; -} \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGResourceVisitor.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGResourceVisitor.h deleted file mode 100644 index 0483dc2d..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGResourceVisitor.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -class CAGResourceVisitor -{ -public: - CAGResourceVisitor(void); - ~CAGResourceVisitor(void); - - static BOOL PASCAL SaveResourceToFile(LPCTSTR lpResourceType, WORD wResourceID, LPCTSTR lpFilePath); - - // ΪWINDOWS·Ŀ¼ָ׼ʽһ£תᷢ - static LPCSTR PASCAL TransWinPathA(LPCSTR lpWinPath, LPSTR lpStandardPath, SIZE_T cchSize); - static LPCWSTR PASCAL TransWinPathW(LPCWSTR lpWinPath, LPWSTR lpStandardPath, SIZE_T cchSize); -}; diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGScreenCaptureDlg.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGScreenCaptureDlg.cpp deleted file mode 100644 index 21b3c91a..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGScreenCaptureDlg.cpp +++ /dev/null @@ -1,210 +0,0 @@ -// AGScreenCaptureWnd.cpp : ʵļ -// - -#include "stdafx.h" -#include "OpenVideoCall.h" -#include "AGScreenCaptureDlg.h" - - -// CAGScreenCaptureWnd - -IMPLEMENT_DYNAMIC(CAGScreenCaptureDlg, CDialogEx) - -CAGScreenCaptureDlg::CAGScreenCaptureDlg(CWnd* pParent) - : m_hMarkWnd(NULL) -{ - -} - -CAGScreenCaptureDlg::~CAGScreenCaptureDlg() -{ -} - - -BEGIN_MESSAGE_MAP(CAGScreenCaptureDlg, CDialogEx) - ON_WM_MOUSEMOVE() - ON_WM_PAINT() - ON_WM_ERASEBKGND() - ON_WM_SHOWWINDOW() - ON_WM_LBUTTONDBLCLK() - ON_WM_RBUTTONDOWN() -END_MESSAGE_MAP() - - - -// CAGScreenCaptureWnd Ϣ -int CAGScreenCaptureDlg::RefreashWndInfo() -{ - m_listWnd.RemoveAll(); - ::EnumWindows(&CAGScreenCaptureDlg::WndEnumProc, (LPARAM)&m_listWnd); - - return static_cast(m_listWnd.GetCount()); -} - -BOOL CAGScreenCaptureDlg::SaveScreen(LPCRECT lpRect) -{ - CDC dcDesktop; - CRect rcDesktop; - CRect rcDest; - - CBitmap *lpOldBitmap = NULL; - - CWnd *lpWndDesktop = GetDesktopWindow(); - CDC *lpDCDesktop = lpWndDesktop->GetDC(); - - lpWndDesktop->GetWindowRect(&rcDesktop); - - if (lpRect == NULL) - rcDest.CopyRect(&rcDesktop); - else { - if (lpRect->left < rcDesktop.left || lpRect->top < rcDesktop.top || lpRect->right > rcDesktop.right || lpRect->bottom > rcDesktop.bottom) - return FALSE; - else - rcDest.CopyRect(lpRect); - } - - dcDesktop.CreateCompatibleDC(lpDCDesktop); - - if (m_bmpDesktop.GetSafeHandle() != NULL) - m_bmpDesktop.DeleteObject(); - - m_bmpDesktop.CreateCompatibleBitmap(lpDCDesktop, rcDest.Width(), rcDest.Height()); - lpOldBitmap = dcDesktop.SelectObject(&m_bmpDesktop); - dcDesktop.BitBlt(0, 0, rcDesktop.Width(), rcDesktop.Height(), lpDCDesktop, 0, 0, SRCCOPY); - dcDesktop.SelectObject(lpOldBitmap); - - return TRUE; -} - -void CAGScreenCaptureDlg::OnMouseMove(UINT nFlags, CPoint point) -{ - // TODO: ڴϢ/Ĭֵ - POSITION pos = m_listWnd.GetHeadPosition(); - CRect rcMarkWnd; - HWND hMarkWnd = NULL; - HWND hFound = NULL; - - while (pos != NULL) { - hFound = m_listWnd.GetNext(pos); - ::GetWindowRect(hFound, &rcMarkWnd); - if (rcMarkWnd.PtInRect(point)) { - hMarkWnd = hFound; - break; - } - } - - if (hMarkWnd != m_hMarkWnd) { - m_hMarkWnd = hMarkWnd; - Invalidate(); - } - - CDialogEx::OnMouseMove(nFlags, point); -} - - -void CAGScreenCaptureDlg::OnPaint() -{ - CPaintDC dc(this); - CDC dcBuffer; - CBitmap bmpBuffer; - // TODO: ڴ˴Ϣ - // ΪͼϢ CWnd::OnPaint() - CRect rcWindow; - BLENDFUNCTION blend; - GetWindowRect(&rcWindow); - - CBrush brBack; - brBack.CreateSolidBrush(RGB(0x00, 0x00, 0x00)); - dcBuffer.CreateCompatibleDC(&dc); - bmpBuffer.CreateCompatibleBitmap(&dc, rcWindow.Width(), rcWindow.Height()); - - CBitmap *lpOldBitmap = dcBuffer.SelectObject(&bmpBuffer); - dcBuffer.FillRect(&rcWindow, &brBack); - - blend.BlendOp = AC_SRC_OVER; - blend.AlphaFormat = 0; - blend.SourceConstantAlpha = 0x80; - blend.BlendFlags = 0; - - dc.AlphaBlend(0, 0, rcWindow.Width(), rcWindow.Height(), &dcBuffer, 0, 0, rcWindow.Width(), rcWindow.Height(), blend); - - if (m_hMarkWnd != NULL) { - CRect rcMarkWnd; - CDC dcBitmap; - CPen penMark; - CString strTip; - - penMark.CreatePen(PS_SOLID, 4, RGB(0x00, 0xA0, 0xE9)); - ::GetWindowRect(m_hMarkWnd, &rcMarkWnd); - dcBitmap.CreateCompatibleDC(&dc); - dcBitmap.SelectObject(&m_bmpDesktop); - dc.BitBlt(rcMarkWnd.left, rcMarkWnd.top, rcMarkWnd.Width(), rcMarkWnd.Height(), &dcBitmap, rcMarkWnd.left, rcMarkWnd.top, SRCCOPY); - - dc.SelectObject(&penMark); - dc.SelectStockObject(NULL_BRUSH); - dc.Rectangle(&rcMarkWnd); - - strTip = _T("double click to share this window or ESC to abort"); -// dc.SetBkMode(TRANSPARENT); - dc.SetBkColor(RGB(0x00, 0xA0, 0xE9)); - dc.SetTextColor(RGB(0xFF, 0xFF, 0xFF)); - dc.TextOut(rcMarkWnd.left + 10, rcMarkWnd.top+10, strTip); - } -} - - -BOOL CALLBACK CAGScreenCaptureDlg::WndEnumProc(HWND hWnd, LPARAM lParam) -{ - CList *lpListctrl = (CList *)lParam; - - LONG lStyle = ::GetWindowLong(hWnd, GWL_STYLE); - - if ((lStyle&WS_VISIBLE) != 0 && (lStyle&(WS_POPUP | WS_SYSMENU)) != 0) - lpListctrl->AddTail(hWnd); - - return TRUE; -} - - -BOOL CAGScreenCaptureDlg::OnEraseBkgnd(CDC* pDC) -{ - // TODO: ڴϢ/Ĭֵ - CDC dcBuffer; - dcBuffer.CreateCompatibleDC(pDC); - dcBuffer.SelectObject(&m_bmpDesktop); - - CRect rcWindow; - GetWindowRect(&rcWindow); - pDC->BitBlt(0, 0, rcWindow.Width(), rcWindow.Height(), &dcBuffer, 0, 0, SRCCOPY); - - return TRUE; -} - - -void CAGScreenCaptureDlg::OnShowWindow(BOOL bShow, UINT nStatus) -{ - CDialogEx::OnShowWindow(bShow, nStatus); - - // TODO: ڴ˴Ϣ -// if (!bShow) -// m_bmpDesktop.DeleteObject(); - -} - - -void CAGScreenCaptureDlg::OnLButtonDblClk(UINT nFlags, CPoint point) -{ - // TODO: ڴϢ/Ĭֵ - GetParent()->SendMessage(WM_WINDOWSHARE, (WPARAM)m_hMarkWnd, 0); -// CDialogEx::OnLButtonDblClk(nFlags, point); - CDialogEx::OnOK(); -} - - -void CAGScreenCaptureDlg::OnRButtonDown(UINT nFlags, CPoint point) -{ - // TODO: ڴϢ/Ĭֵ - -// CDialogEx::OnRButtonDown(nFlags, point); - CDialogEx::OnOK(); -} diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGScreenCaptureDlg.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGScreenCaptureDlg.h deleted file mode 100644 index c5efb7ed..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGScreenCaptureDlg.h +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once -#include "afxcoll.h" - -#define WM_WINDOWSHARE WM_USER+303 -// CAGScreenCaptureWnd - -class CAGScreenCaptureDlg : public CDialogEx -{ - DECLARE_DYNAMIC(CAGScreenCaptureDlg) - -public: - CAGScreenCaptureDlg(CWnd* pParent = NULL); - virtual ~CAGScreenCaptureDlg(); - - enum { IDD = IDD_SCRCAP_DIALOG }; - - int RefreashWndInfo(); - BOOL SaveScreen(LPCRECT lpRect); - -protected: - afx_msg void OnMouseMove(UINT nFlags, CPoint point); - afx_msg void OnPaint(); - - afx_msg BOOL OnEraseBkgnd(CDC* pDC); - afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); - - DECLARE_MESSAGE_MAP() - - static BOOL CALLBACK WndEnumProc(HWND hWnd, LPARAM lParam); - -private: - CBitmap m_bmpDesktop; - - CList m_listWnd; - HWND m_hMarkWnd; - -public: - - afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); - afx_msg void OnRButtonDown(UINT nFlags, CPoint point); -}; - - diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGSliderCtrl.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGSliderCtrl.cpp deleted file mode 100644 index 1b5cdfae..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGSliderCtrl.cpp +++ /dev/null @@ -1,202 +0,0 @@ -// AGSliderCtrl.cpp : ʵļ -// - -#include "stdafx.h" -#include "AGSliderCtrl.h" - - -// CAGSliderCtrl - -IMPLEMENT_DYNAMIC(CAGSliderCtrl, CSliderCtrl) - -CAGSliderCtrl::CAGSliderCtrl() -: m_dwChannelHeight(2) -, m_nThumbHeight(0) -, m_nThumbWidth(0) -, m_bHover(FALSE) -{ - m_brChannel.CreateSolidBrush(RGB(0xC8, 0xC8, 0xC8)); - m_brChannelHot.CreateSolidBrush(RGB(0x00, 0xA0, 0xEB)); - m_brBack.CreateSolidBrush(RGB(0xFF, 0xFF, 0xFF)); -} - -CAGSliderCtrl::~CAGSliderCtrl() -{ - m_brChannel.DeleteObject(); - m_brChannelHot.DeleteObject(); - m_brBack.DeleteObject(); -} - - -BEGIN_MESSAGE_MAP(CAGSliderCtrl, CSliderCtrl) - ON_NOTIFY_REFLECT(NM_CUSTOMDRAW, &CAGSliderCtrl::OnNMCustomdraw) - ON_WM_MOUSEMOVE() - ON_WM_MOUSELEAVE() -END_MESSAGE_MAP() - - - -// CAGSliderCtrl Ϣ -BOOL CAGSliderCtrl::SetThumbBitmap(UINT nIDNormal, UINT nIDHover, UINT nIDPush, COLORREF crMaskColor) -{ - CBitmap bmpMap; - BITMAP bmpInfo; - BOOL bSuccess = FALSE; - - bSuccess = bmpMap.LoadBitmap(nIDNormal); - if (!bSuccess) - return FALSE; - - bmpMap.GetBitmap(&bmpInfo); - m_imgThumb.DeleteImageList(); - m_imgThumb.Create(bmpInfo.bmWidth, bmpInfo.bmHeight, ILC_COLOR24 | ILC_MASK, 3, 1); - m_nThumbHeight = bmpInfo.bmHeight; - m_nThumbWidth = bmpInfo.bmWidth; - - m_imgThumb.Add(&bmpMap, crMaskColor); - if (nIDHover != 0) { - bmpMap.DeleteObject(); - bSuccess = bmpMap.LoadBitmap(nIDHover); - } - - if (bSuccess) - m_imgThumb.Add(&bmpMap, crMaskColor); - if (nIDPush != 0) { - bmpMap.DeleteObject(); - bSuccess = bmpMap.LoadBitmap(nIDPush); - } - - if (bSuccess) - m_imgThumb.Add(&bmpMap, crMaskColor); - - bmpMap.DeleteObject(); - - return bSuccess; -} - -BOOL CAGSliderCtrl::SetChannelColor(COLORREF crNormal, COLORREF crHot) -{ - m_brChannel.DeleteObject(); - m_brChannelHot.DeleteObject(); - - m_brChannel.CreateSolidBrush(crNormal); - m_brChannelHot.CreateSolidBrush(crHot); - - return TRUE; -} -BOOL CAGSliderCtrl::SetBkColor(COLORREF crBkColor) -{ - m_brBack.DeleteObject(); - - return m_brBack.CreateSolidBrush(crBkColor); -} - -void CAGSliderCtrl::OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult) -{ - LPNMCUSTOMDRAW lpCustomDraw = (LPNMCUSTOMDRAW)pNMHDR; - CDC *pDC = CDC::FromHandle(lpCustomDraw->hdc); - - switch (lpCustomDraw->dwDrawStage) - { - case CDDS_PREPAINT: - *pResult = CDRF_NOTIFYITEMDRAW; - break; - case CDDS_ITEMPREPAINT: - { - switch (lpCustomDraw->dwItemSpec) - { - case TBCD_TICS: - *pResult = CDRF_DODEFAULT; - break; - case TBCD_THUMB: - *pResult = OnDrawThumb(pDC, lpCustomDraw); - break; - case TBCD_CHANNEL: - *pResult = OnDrawChannel(pDC, lpCustomDraw); - break; - } - break; - } - } -} - -LRESULT CAGSliderCtrl::OnDrawThumb(CDC *pDC, LPNMCUSTOMDRAW lpCustomDraw) -{ - if (m_imgThumb.GetSafeHandle() == NULL || m_imgThumb.GetImageCount() == 0) - return CDRF_DODEFAULT; - - CRect rcThumb; - GetThumbRect(&rcThumb); - CPoint ptThumb = rcThumb.CenterPoint(); - ptThumb.Offset(-m_nThumbWidth/2, -m_nThumbHeight/2); - - if ( (lpCustomDraw->uItemState&CDIS_SELECTED) || m_bHover ) - m_imgThumb.Draw(pDC, 2, ptThumb, ILD_NORMAL); - else - m_imgThumb.Draw(pDC, 0, ptThumb, ILD_NORMAL); - - Invalidate(FALSE); - lpCustomDraw->rc.left = ptThumb.x; - lpCustomDraw->rc.top = ptThumb.y; - lpCustomDraw->rc.right = ptThumb.x + m_nThumbWidth; - lpCustomDraw->rc.right = ptThumb.y + m_nThumbHeight; - - return CDRF_SKIPDEFAULT; -} - -LRESULT CAGSliderCtrl::OnDrawChannel(CDC *pDC, LPNMCUSTOMDRAW lpCustomDraw) -{ - CRect rcThumb; - CRect rcChannel; - CRect rcDraw; - - GetClientRect(&rcDraw); - GetThumbRect(&rcThumb); - GetChannelRect(&rcChannel); - - pDC->FillRect(&rcDraw, &m_brBack); - - rcChannel.top = rcThumb.CenterPoint().y - m_dwChannelHeight / 2; - rcChannel.bottom = rcThumb.CenterPoint().y + m_dwChannelHeight / 2; - - rcDraw.CopyRect(&rcChannel); - rcDraw.right = rcThumb.left; - pDC->FillRect(&rcDraw, &m_brChannelHot); - - rcDraw.CopyRect(&rcChannel); - rcDraw.left = rcThumb.right; - pDC->FillRect(&rcDraw, &m_brChannel); - - return CDRF_SKIPDEFAULT; -} - - -void CAGSliderCtrl::OnMouseMove(UINT nFlags, CPoint point) -{ - // TODO: ڴϢ/Ĭֵ - CRect rcThumbRect; - BOOL bLastState = m_bHover; - - GetThumbRect(&rcThumbRect); - if (rcThumbRect.PtInRect(point)) - m_bHover = TRUE; - else - m_bHover = FALSE; - - if (bLastState != m_bHover) - InvalidateRect(rcThumbRect); - - CSliderCtrl::OnMouseMove(nFlags, point); -} - -void CAGSliderCtrl::OnMouseLeave() -{ - // TODO: ڴϢ/Ĭֵ - m_bHover = FALSE; - - CRect rcThumb; - GetThumbRect(&rcThumb); - InvalidateRect(rcThumb); - - CSliderCtrl::OnMouseLeave(); -} \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGSliderCtrl.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGSliderCtrl.h deleted file mode 100644 index df5c3faa..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGSliderCtrl.h +++ /dev/null @@ -1,45 +0,0 @@ -#pragma once - - - -// CAGSliderCtrl - -class CAGSliderCtrl : public CSliderCtrl -{ - DECLARE_DYNAMIC(CAGSliderCtrl) - -public: - CAGSliderCtrl(); - virtual ~CAGSliderCtrl(); - - BOOL SetThumbBitmap(UINT nIDNormal, UINT nIDHover = 0, UINT nIDPush = 0, COLORREF crMaskColor = RGB(0xFF, 0, 0xFF)); - BOOL SetChannelColor(COLORREF crNormal = RGB(0xC8, 0xC8, 0xC8), COLORREF crHot = RGB(0x00, 0xA0, 0xEB)); - BOOL SetChannelHeight(DWORD dwChannelHeight = 2); - BOOL SetBkColor(COLORREF crBkColor = RGB(0xFF, 0xFF, 0xFF)); - -protected: - afx_msg void OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult); - afx_msg void OnMouseMove(UINT nFlags, CPoint point); - afx_msg void OnMouseLeave(); - - DECLARE_MESSAGE_MAP() - -protected: - LRESULT OnDrawThumb(CDC *pDC, LPNMCUSTOMDRAW lpCustomDraw); - LRESULT OnDrawChannel(CDC *pDC, LPNMCUSTOMDRAW lpCustomDraw); - -private: - CImageList m_imgThumb; - - CBrush m_brBack; - CBrush m_brChannel; - CBrush m_brChannelHot; - - DWORD m_dwChannelHeight; - int m_nThumbHeight; - int m_nThumbWidth; - - BOOL m_bHover; -}; - - diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGVideoTestWnd.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGVideoTestWnd.cpp deleted file mode 100644 index db024c5e..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGVideoTestWnd.cpp +++ /dev/null @@ -1,114 +0,0 @@ -// AGVideoTestWnd.cpp : ʵļ -// - -#include "stdafx.h" -#include "OpenVideoCall.h" -#include "AGVideoTestWnd.h" - - -// CAGVideoTestWnd - -IMPLEMENT_DYNAMIC(CAGVideoTestWnd, CWnd) - -CAGVideoTestWnd::CAGVideoTestWnd() -: m_nVolRange(255) -, m_nCurVol(0) -, m_crVolbarFreeColor(RGB(32, 32, 32)) -, m_crVolbarBusyColor(RGB(208, 208, 208)) -, m_crVolbarBackColor(RGB(0x26, 0x26, 0x26)) -, m_crBackColor(RGB(0x70, 0x70, 0x70)) -, m_nVolbarWidth(15) -{ - -} - -CAGVideoTestWnd::~CAGVideoTestWnd() -{ -} - - -BEGIN_MESSAGE_MAP(CAGVideoTestWnd, CWnd) - ON_WM_PAINT() - ON_WM_CREATE() - ON_WM_SIZE() -END_MESSAGE_MAP() - - - -// CAGVideoTestWnd Ϣ - -int CAGVideoTestWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) -{ - if (CWnd::OnCreate(lpCreateStruct) == -1) - return -1; - - // TODO: ڴרõĴ - CRect rcChildRect; - - DWORD dwWndStyle = WS_VISIBLE | WS_CHILD; - rcChildRect.SetRect(15, 0, lpCreateStruct->cx-30, lpCreateStruct->cy); - m_wndVideoWnd.Create(NULL, _T("AgoraVideoWnd"), dwWndStyle, rcChildRect, this, IDC_STATIC); - - return 0; -} - -void CAGVideoTestWnd::OnPaint() -{ - // TODO: ڴ˴Ϣ - // ΪͼϢ CWnd::OnPaint() - CPaintDC dc(this); - - CRect rcClient; - - GetClientRect(&rcClient); - dc.FillSolidRect(0, 0, rcClient.Width(), rcClient.Height(), m_crBackColor); - - dc.FillSolidRect(0, 0, m_nVolbarWidth, rcClient.Height(), m_crVolbarBackColor); - dc.FillSolidRect(rcClient.Width() - m_nVolbarWidth, 0, m_nVolbarWidth, rcClient.Height(), m_crVolbarBackColor); - - int nMarkCount = rcClient.Height() / 5; - int nTopPoint = m_nCurVol*nMarkCount / m_nVolRange; - - for (int nIndex = 0; nIndex < nMarkCount; nIndex++) { - if (nIndex <= nTopPoint) { - dc.FillSolidRect(0, rcClient.bottom - 5 * nIndex - 3, m_nVolbarWidth, 3, m_crVolbarBusyColor); - dc.FillSolidRect(rcClient.Width() - m_nVolbarWidth, rcClient.bottom - 5 * nIndex - 3, m_nVolbarWidth, 3, m_crVolbarBusyColor); - } - else { - dc.FillSolidRect(0, rcClient.bottom - 5 * nIndex - 3, m_nVolbarWidth, 3, m_crVolbarFreeColor); - dc.FillSolidRect(rcClient.Width() - m_nVolbarWidth, rcClient.bottom - 5 * nIndex - 3, m_nVolbarWidth, 3, m_crVolbarFreeColor); - } - } -} - - -void CAGVideoTestWnd::SetVolRange(int nRange) -{ - if (nRange > 100 || nRange < 0) - nRange = 100; - - m_nVolRange = nRange; - - Invalidate(FALSE); -} - -void CAGVideoTestWnd::SetCurVol(int nCurVol) -{ - if (nCurVol < 0 || nCurVol > m_nVolRange) - nCurVol = 0; - - m_nCurVol = nCurVol; - - InvalidateRect(FALSE); -} - - -void CAGVideoTestWnd::OnSize(UINT nType, int cx, int cy) -{ - CWnd::OnSize(nType, cx, cy); - - if (m_wndVideoWnd.GetSafeHwnd() != NULL) - m_wndVideoWnd.MoveWindow(15, 0, cx - 30, cy); - - // TODO: ڴ˴Ϣ -} diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGVideoTestWnd.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGVideoTestWnd.h deleted file mode 100644 index 8d2a7fa7..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGVideoTestWnd.h +++ /dev/null @@ -1,45 +0,0 @@ -#pragma once - - -// CAGVideoTestWnd - -class CAGVideoTestWnd : public CWnd -{ - DECLARE_DYNAMIC(CAGVideoTestWnd) - -public: - CAGVideoTestWnd(); - virtual ~CAGVideoTestWnd(); - - HWND GetVideoSafeHwnd() { return m_wndVideoWnd.GetSafeHwnd(); }; - - // ָʾ - - void SetVolbarColor(DWORD dwFreeColor = RGB(184, 184, 184), DWORD dwBusyColor = RGB(0, 255, 0), DWORD dwBackColor = RGB(0, 0, 0)); // 趨ɫ - void SetVolRange(int nRange = 100); - void SetCurVol(int nCurVol = 0); - -protected: - afx_msg void OnPaint(); - afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); - - DECLARE_MESSAGE_MAP() - -private: - CWnd m_wndVideoWnd; // the wnd for show video - - int m_nVolbarWidth; - - int m_nVolbarPos; // the vol bar pos - int m_nVolRange; // the max vol - int m_nCurVol; // the current vol - - COLORREF m_crBackColor; - COLORREF m_crVolbarFreeColor; - COLORREF m_crVolbarBusyColor; - COLORREF m_crVolbarBackColor; -public: - afx_msg void OnSize(UINT nType, int cx, int cy); -}; - - diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGVideoWnd.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGVideoWnd.cpp deleted file mode 100644 index 7ea120e2..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGVideoWnd.cpp +++ /dev/null @@ -1,357 +0,0 @@ -// AGVideoWnd.cpp : ʵļ -// - -#include "stdafx.h" -#include "OpenVideoCall.h" -#include "AGVideoWnd.h" - -IMPLEMENT_DYNAMIC(CAGInfoWnd, CWnd) - -CAGInfoWnd::CAGInfoWnd() -: m_bShowTip(TRUE) -, m_nWidth(0) -, m_nHeight(0) -, m_nFps(0) -, m_nBitrate(0) -{ - m_brBack.CreateSolidBrush(RGB(0x00, 0xA0, 0xE9)); -} - -CAGInfoWnd::~CAGInfoWnd() -{ - m_brBack.DeleteObject(); -} - - -BEGIN_MESSAGE_MAP(CAGInfoWnd, CWnd) - ON_WM_PAINT() - ON_WM_ERASEBKGND() -END_MESSAGE_MAP() - - -void CAGInfoWnd::ShowTips(BOOL bShow) -{ - m_bShowTip = bShow; - - if (bShow) - ShowWindow(SW_SHOW); - else - ShowWindow(SW_HIDE); - - Invalidate(FALSE); -} - -void CAGInfoWnd::SetVideoResolution(int nWidth, int nHeight) -{ - m_nWidth = nWidth; - m_nHeight = nHeight; - - if (m_bShowTip) { - Invalidate(TRUE); - UpdateWindow(); - } -} - -void CAGInfoWnd::SetFrameRateInfo(int nFPS) -{ - m_nFps = nFPS; - - if (m_bShowTip) { - Invalidate(TRUE); - UpdateWindow(); - } -} - -void CAGInfoWnd::SetBitrateInfo(int nBitrate) -{ - m_nBitrate = nBitrate; - - if (m_bShowTip) { - Invalidate(TRUE); - UpdateWindow(); - } -} - -void CAGInfoWnd::OnPaint() -{ - CPaintDC dc(this); - CRect rcClient; - CString strTip; - - dc.SetBkMode(TRANSPARENT); - dc.SetTextColor(RGB(0xFF, 0xFF, 0xFF)); - - if (m_bShowTip) { - // 640x480,15fps,400k - GetClientRect(&rcClient); - rcClient.top += 4; - strTip.Format(_T("%dx%d, %dfps, %dK"), m_nWidth, m_nHeight, m_nFps, m_nBitrate); - dc.DrawText(strTip, &rcClient, DT_VCENTER | DT_CENTER); - } -} - -BOOL CAGInfoWnd::OnEraseBkgnd(CDC* pDC) -{ - // TODO: ڴϢ/Ĭֵ - CRect rcClient; - - GetClientRect(&rcClient); - pDC->FillRect(&rcClient, &m_brBack); - - return TRUE; -} - -// CAGVideoWnd - -IMPLEMENT_DYNAMIC(CAGVideoWnd, CWnd) - -CAGVideoWnd::CAGVideoWnd() -: m_nUID(0) -, m_crBackColor(RGB(0x58, 0x58, 0x58)) -, m_bShowVideoInfo(FALSE) -, m_bBigShow(FALSE) -, m_bBackground(FALSE) -{ - -} - -CAGVideoWnd::~CAGVideoWnd() -{ - m_imgBackGround.DeleteImageList(); -} - - -BEGIN_MESSAGE_MAP(CAGVideoWnd, CWnd) - ON_WM_ERASEBKGND() - ON_WM_LBUTTONDOWN() - ON_WM_RBUTTONDOWN() - ON_WM_CREATE() - ON_WM_PAINT() - ON_WM_SIZE() - ON_WM_LBUTTONDBLCLK() - ON_WM_PAINT() -END_MESSAGE_MAP() - - - -// CAGVideoWnd Ϣ -BOOL CAGVideoWnd::OnEraseBkgnd(CDC* pDC) -{ - // TODO: ڴϢ/Ĭֵ - CRect rcClient; - CPoint ptDraw; - IMAGEINFO imgInfo; - - GetClientRect(&rcClient); - - pDC->FillSolidRect(&rcClient, m_crBackColor); - if (!m_imgBackGround.GetImageInfo(0, &imgInfo)) - return TRUE; - - ptDraw.SetPoint((rcClient.Width() - imgInfo.rcImage.right) / 2, (rcClient.Height() - imgInfo.rcImage.bottom) / 2); - if (ptDraw.x < 0) - ptDraw.x = 0; - if (ptDraw.y <= 0) - ptDraw.y = 0; - - m_imgBackGround.Draw(pDC, 0, ptDraw, ILD_NORMAL); - return TRUE; -} - -void CAGVideoWnd::SetUID(UINT nUID) -{ - m_nUID = nUID; - - if (m_nUID == 0) - m_wndInfo.ShowWindow(SW_HIDE); - else - m_wndInfo.ShowWindow(SW_SHOW); -} - -UINT CAGVideoWnd::GetUID() -{ - return m_nUID; -} - -BOOL CAGVideoWnd::IsWndFree() -{ - return m_nUID == 0 ? TRUE : FALSE; -} - -BOOL CAGVideoWnd::SetBackImage(UINT nID, UINT nWidth, UINT nHeight, COLORREF crMask) -{ - CBitmap bmBackImage; - - if (!bmBackImage.LoadBitmap(nID)) - return FALSE; - - m_imgBackGround.DeleteImageList(); - - m_imgBackGround.Create(nWidth, nHeight, ILC_COLOR24 | ILC_MASK, 1, 1); - m_imgBackGround.Add(&bmBackImage, crMask); - bmBackImage.DeleteObject(); - - Invalidate(TRUE); - - return TRUE; -} - -void CAGVideoWnd::ShowBackground(BOOL bBackground) -{ - m_bBackground = bBackground; - - Invalidate(TRUE); -} - -void CAGVideoWnd::SetFaceColor(COLORREF crBackColor) -{ - m_crBackColor = crBackColor; - - Invalidate(TRUE); -} - -void CAGVideoWnd::SetVideoResolution(UINT nWidth, UINT nHeight) -{ - m_nWidth = nWidth; - m_nHeight = nHeight; - - m_wndInfo.SetVideoResolution(nWidth, nHeight); -} - -void CAGVideoWnd::GetVideoResolution(UINT *nWidth, UINT *nHeight) -{ - *nWidth = m_nWidth; - *nHeight = m_nHeight; -} - -void CAGVideoWnd::SetBitrateInfo(int nReceivedBitrate) -{ - m_nBitRate = nReceivedBitrate; - m_wndInfo.SetBitrateInfo(nReceivedBitrate); -} - -void CAGVideoWnd::SetFrameRateInfo(int nReceiveFrameRate) -{ - m_nFrameRate = nReceiveFrameRate; - m_wndInfo.SetFrameRateInfo(nReceiveFrameRate); -} - -void CAGVideoWnd::OnLButtonDown(UINT nFlags, CPoint point) -{ - // TODO: ڴϢ/Ĭֵ - - ::SendMessage(GetParent()->GetSafeHwnd(), WM_SHOWBIG, (WPARAM)this, (LPARAM)m_nUID); - - CWnd::OnLButtonDown(nFlags, point); -} - - -void CAGVideoWnd::OnRButtonDown(UINT nFlags, CPoint point) -{ - // TODO: ڴϢ/Ĭֵ - ::SendMessage(GetParent()->GetSafeHwnd(), WM_SHOWMODECHANGED, (WPARAM)this, (LPARAM)m_nUID); - - CWnd::OnRButtonDown(nFlags, point); -} - - -int CAGVideoWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) -{ - if (CWnd::OnCreate(lpCreateStruct) == -1) - return -1; - - // TODO: ڴרõĴ - m_wndInfo.Create(NULL, NULL, WS_CHILD | WS_VISIBLE, CRect(0, 0, 192, 28), this, IDC_STATIC); - - return 0; -} - - -void CAGVideoWnd::ShowVideoInfo(BOOL bShow) -{ - m_bShowVideoInfo = bShow; - - m_wndInfo.ShowTips(bShow); - Invalidate(TRUE); - -/* if (!bShow) { - CRect rcTip; - m_wndInfo.GetWindowRect(&rcTip); - - } - */ - -} - -void CAGVideoWnd::SetBigShowFlag(BOOL bBigShow) -{ - CRect rcClient; - - m_bBigShow = bBigShow; - GetClientRect(&rcClient); - - int x = (rcClient.Width()- 192) / 2; - int y = rcClient.Height() - 24; - - if (m_wndInfo.GetSafeHwnd() != NULL) { - if (m_bBigShow) - y -= 4; - - m_wndInfo.MoveWindow(x, y, 192, 24); - } -}; - - -void CAGVideoWnd::OnSize(UINT nType, int cx, int cy) -{ - CWnd::OnSize(nType, cx, cy); - - int x = (cx - 192) / 2; - int y = cy - 24; - // TODO: ڴ˴Ϣ - if (m_wndInfo.GetSafeHwnd() != NULL) { - if (m_bBigShow) - y -= 4; - - m_wndInfo.MoveWindow(x, y, 192, 24); - } -} - - -void CAGVideoWnd::OnLButtonDblClk(UINT nFlags, CPoint point) -{ - // TODO: ڴϢ/Ĭֵ - ::SendMessage(GetParent()->GetSafeHwnd(), WM_SHOWMODECHANGED, (WPARAM)this, (LPARAM)m_nUID); - - CWnd::OnLButtonDblClk(nFlags, point); -} - - -void CAGVideoWnd::OnPaint() -{ - CPaintDC dc(this); // device context for painting - // TODO: ڴ˴Ϣ - // ΪͼϢ CWnd::OnPaint() - - if (m_bBackground) { - CRect rcClient; - CPoint ptDraw; - IMAGEINFO imgInfo; - - GetClientRect(&rcClient); - - dc.FillSolidRect(&rcClient, m_crBackColor); - if (!m_imgBackGround.GetImageInfo(0, &imgInfo)) - return; - - ptDraw.SetPoint((rcClient.Width() - imgInfo.rcImage.right) / 2, (rcClient.Height() - imgInfo.rcImage.bottom) / 2); - if (ptDraw.x < 0) - ptDraw.x = 0; - if (ptDraw.y <= 0) - ptDraw.y = 0; - - m_imgBackGround.Draw(&dc, 0, ptDraw, ILD_NORMAL); - } - else - return CWnd::OnPaint(); -} diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGVideoWnd.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGVideoWnd.h deleted file mode 100644 index 8809da9b..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGVideoWnd.h +++ /dev/null @@ -1,104 +0,0 @@ -#pragma once - -#define WM_SHOWMODECHANGED WM_USER+300 -#define WM_SHOWBIG WM_USER+301 - -class CAGInfoWnd : public CWnd -{ - DECLARE_DYNAMIC(CAGInfoWnd) - -public: - CAGInfoWnd(); - virtual ~CAGInfoWnd(); - - void ShowTips(BOOL bShow = TRUE); - void SetVideoResolution(int nWidth, int nHeight); - void SetFrameRateInfo(int nFPS); - void SetBitrateInfo(int nBitrate); - -protected: - afx_msg void OnPaint(); - afx_msg BOOL OnEraseBkgnd(CDC* pDC); - - DECLARE_MESSAGE_MAP() - -private: - BOOL m_bShowTip; - - COLORREF m_crBackColor; - - int m_nWidth; - int m_nHeight; - int m_nFps; - int m_nBitrate; - - CBrush m_brBack; -}; - - -class CAGVideoWnd : public CWnd -{ - DECLARE_DYNAMIC(CAGVideoWnd) - -public: - CAGVideoWnd(); - virtual ~CAGVideoWnd(); - - void SetUID(UINT dwUID); - - UINT GetUID(); - BOOL IsWndFree(); - - void SetFaceColor(COLORREF crBackColor); - BOOL SetBackImage(UINT nID, UINT nWidth, UINT nHeight, COLORREF crMask = RGB(0xFF, 0xff, 0xFF)); - - void ShowBackground(BOOL bBackground); - BOOL IsBackgroundMode() { return m_bBackground; }; - - void SetVideoResolution(UINT nWidth, UINT nHeight); - void GetVideoResolution(UINT *nWidth, UINT *nHeight); - - void SetBitrateInfo(int nReceivedBitrate); - int GetBitrateInfo() { return m_nBitRate; }; - - void SetFrameRateInfo(int nReceiveFrameRate); - int GetFrameRateInfo() { return m_nFrameRate; }; - - void ShowVideoInfo(BOOL bShow); - BOOL IsVideoInfoShowed() { return m_bShowVideoInfo; }; - - void SetBigShowFlag(BOOL bBigShow); - BOOL IsBigShow() { return m_bBigShow; }; - -protected: - afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); - afx_msg BOOL OnEraseBkgnd(CDC* pDC); - afx_msg void OnLButtonDown(UINT nFlags, CPoint point); - afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); - afx_msg void OnRButtonDown(UINT nFlags, CPoint point); - afx_msg void OnSize(UINT nType, int cx, int cy); - - DECLARE_MESSAGE_MAP() - -private: - CImageList m_imgBackGround; - COLORREF m_crBackColor; - - CAGInfoWnd m_wndInfo; - -private: - UINT m_nUID; - - UINT m_nWidth; - UINT m_nHeight; - int m_nFrameRate; - int m_nBitRate; - BOOL m_bShowVideoInfo; - BOOL m_bBigShow; - - BOOL m_bBackground; -public: - afx_msg void OnPaint(); -}; - - diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraAudInputManager.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraAudInputManager.cpp deleted file mode 100644 index b5073e5e..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraAudInputManager.cpp +++ /dev/null @@ -1,165 +0,0 @@ -#include "stdafx.h" -#include "AgoraAudInputManager.h" - - -CAgoraAudInputManager::CAgoraAudInputManager() - : m_ptrDeviceManager(NULL) - , m_lpCollection(NULL) - , m_bTestingOn(FALSE) -{ -} - - -CAgoraAudInputManager::~CAgoraAudInputManager() -{ - Close(); -} - -BOOL CAgoraAudInputManager::Create(IRtcEngine *lpRtcEngine) -{ - m_ptrDeviceManager = new AAudioDeviceManager(lpRtcEngine); - if (m_ptrDeviceManager == NULL || m_ptrDeviceManager->get() == NULL) - return FALSE; - - m_lpCollection = (*m_ptrDeviceManager)->enumerateRecordingDevices(); - if (m_lpCollection == NULL) { - delete m_ptrDeviceManager; - m_ptrDeviceManager = NULL; - } - - - return m_lpCollection != NULL ? TRUE : FALSE; -} - -void CAgoraAudInputManager::Close() -{ - if (m_lpCollection != NULL){ - m_lpCollection->release(); - m_lpCollection = NULL; - } - - if (m_ptrDeviceManager != NULL) { - delete m_ptrDeviceManager; - m_ptrDeviceManager = NULL; - } -} - -UINT CAgoraAudInputManager::GetVolume() -{ - int nVol = 0; - - if (m_ptrDeviceManager == NULL || m_ptrDeviceManager->get() == NULL) - return 0; - - (*m_ptrDeviceManager)->getRecordingDeviceVolume(&nVol); - - return (UINT)nVol; -} - -BOOL CAgoraAudInputManager::SetVolume(UINT nVol) -{ - if (m_ptrDeviceManager == NULL || m_ptrDeviceManager->get() == NULL) - return FALSE; - - int nRet = (*m_ptrDeviceManager)->setRecordingDeviceVolume((int)nVol); - - return nRet == 0 ? TRUE : FALSE; -} - -UINT CAgoraAudInputManager::GetDeviceCount() -{ - if (m_lpCollection != NULL) - return (UINT)m_lpCollection->getCount(); - - return 0; -} - -BOOL CAgoraAudInputManager::GetDevice(UINT nIndex, CString &rDeviceName, CString &rDeviceID) -{ - CHAR szDeviceName[MAX_DEVICE_ID_LENGTH]; - CHAR szDeviceID[MAX_DEVICE_ID_LENGTH]; - - ASSERT(nIndex < GetDeviceCount()); - - if (nIndex >= GetDeviceCount()) - return FALSE; - - if (m_lpCollection == NULL) - return FALSE; - - int nRet = m_lpCollection->getDevice(nIndex, szDeviceName, szDeviceID); - if (nRet != 0) - return FALSE; - -#ifdef UNICODE - ::MultiByteToWideChar(CP_UTF8, 0, szDeviceName, -1, rDeviceName.GetBuffer(MAX_DEVICE_ID_LENGTH), MAX_DEVICE_ID_LENGTH); - ::MultiByteToWideChar(CP_UTF8, 0, szDeviceID, -1, rDeviceID.GetBuffer(MAX_DEVICE_ID_LENGTH), MAX_DEVICE_ID_LENGTH); - - rDeviceName.ReleaseBuffer(); - rDeviceID.ReleaseBuffer(); -#else - strDeviceName = szDeviceName; - strDeviceID = szDeviceID; -#endif - - return TRUE; -} - -CString CAgoraAudInputManager::GetCurDeviceID() -{ - CString str; - CHAR szDeviceID[MAX_DEVICE_ID_LENGTH]; - - if (m_ptrDeviceManager == NULL || m_ptrDeviceManager->get() == NULL) - return str; - - (*m_ptrDeviceManager)->getRecordingDevice(szDeviceID); - -#ifdef UNICODE - ::MultiByteToWideChar(CP_UTF8, 0, szDeviceID, -1, str.GetBuffer(MAX_DEVICE_ID_LENGTH), MAX_DEVICE_ID_LENGTH); - str.ReleaseBuffer(); -#else - strDeviceName = szDeviceID; -#endif - - return str; -} - -BOOL CAgoraAudInputManager::SetCurDevice(LPCTSTR lpDeviceID) -{ - if (m_ptrDeviceManager == NULL || m_ptrDeviceManager->get() == NULL) - return FALSE; - -#ifdef UNICODE - CHAR szDeviceID[128]; - ::WideCharToMultiByte(CP_ACP, 0, lpDeviceID, -1, szDeviceID, 128, NULL, NULL); - int nRet = (*m_ptrDeviceManager)->setRecordingDevice(szDeviceID); -#else - int nRet = (*m_ptrDeviceManager)->setRecordingDevice(lpDeviceID); -#endif - - return nRet == 0 ? TRUE : FALSE; -} - -void CAgoraAudInputManager::TestAudInputDevice(HWND hMsgWnd, BOOL bTestOn) -{ - if (m_ptrDeviceManager == NULL || m_ptrDeviceManager->get() == NULL) - return; - - if (bTestOn && !m_bTestingOn) { - m_hOldMsgWnd = CAgoraObject::GetAgoraObject()->GetMsgHandlerWnd(); - CAgoraObject::GetAgoraObject()->SetMsgHandlerWnd(hMsgWnd); - - IRtcEngine *lpRtcEngine = CAgoraObject::GetEngine(); - RtcEngineParameters rep(*lpRtcEngine); - rep.enableAudioVolumeIndication(1000, 10,true); - (*m_ptrDeviceManager)->startRecordingDeviceTest(1000); - } - else if (!bTestOn && m_bTestingOn){ - CAgoraObject::GetAgoraObject()->SetMsgHandlerWnd(m_hOldMsgWnd); - (*m_ptrDeviceManager)->stopRecordingDeviceTest(); - } - - m_bTestingOn = bTestOn; - -} \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraAudInputManager.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraAudInputManager.h deleted file mode 100644 index 8d58061c..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraAudInputManager.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once -class CAgoraAudInputManager -{ -public: - CAgoraAudInputManager(); - ~CAgoraAudInputManager(); - - BOOL Create(IRtcEngine *lpRtcEngine); - void Close(); - - UINT GetVolume(); - BOOL SetVolume(UINT nVol); - UINT GetDeviceCount(); - - CString GetCurDeviceID(); - BOOL SetCurDevice(LPCTSTR lpDeviceID); - - BOOL GetDevice(UINT nIndex, CString &rDeviceName, CString &rDeviceID); - - void TestAudInputDevice(HWND hMsgWnd, BOOL bTestOn); - - BOOL IsTesting() { return m_bTestingOn; }; -private: - BOOL m_bTestingOn; - HWND m_hOldMsgWnd; - AAudioDeviceManager *m_ptrDeviceManager; - IAudioDeviceCollection *m_lpCollection; -}; - diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraCameraManager.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraCameraManager.cpp deleted file mode 100644 index af03dd0f..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraCameraManager.cpp +++ /dev/null @@ -1,134 +0,0 @@ -#include "stdafx.h" -#include "AgoraCameraManager.h" - - -CAgoraCameraManager::CAgoraCameraManager() - : m_ptrDeviceManager(NULL) - , m_lpCollection(NULL) -{ -} - - -CAgoraCameraManager::~CAgoraCameraManager() -{ - Close(); -} - -BOOL CAgoraCameraManager::Create(IRtcEngine *lpRtcEngine) -{ -// lpRtcEngine->enableVideo(); - - m_ptrDeviceManager = new AVideoDeviceManager(lpRtcEngine); - if (m_ptrDeviceManager == NULL || m_ptrDeviceManager->get() == NULL) - return FALSE; - - m_lpCollection = (*m_ptrDeviceManager)->enumerateVideoDevices(); - if (m_lpCollection == NULL) { - delete m_ptrDeviceManager; - m_ptrDeviceManager = NULL; - } - - return m_lpCollection != NULL ? TRUE : FALSE; -} - -void CAgoraCameraManager::Close() -{ - if (m_lpCollection != NULL){ - m_lpCollection->release(); - m_lpCollection = NULL; - } - - if (m_ptrDeviceManager != NULL) { - delete m_ptrDeviceManager; - m_ptrDeviceManager = NULL; - } -} - -UINT CAgoraCameraManager::GetDeviceCount() -{ - if (m_lpCollection == NULL) - return 0; - - return (UINT)m_lpCollection->getCount(); -} - -CString CAgoraCameraManager::GetCurDeviceID() -{ - CString str; - CHAR szDeviceID[MAX_DEVICE_ID_LENGTH]; - - if (m_ptrDeviceManager == NULL || m_ptrDeviceManager->get() == NULL) - return str; - - memset(szDeviceID, 0x00, MAX_DEVICE_ID_LENGTH); - if (m_ptrDeviceManager != NULL && m_ptrDeviceManager->get() != NULL) - (*m_ptrDeviceManager)->getDevice(szDeviceID); - -#ifdef UNICODE - ::MultiByteToWideChar(CP_UTF8, 0, szDeviceID, -1, str.GetBuffer(MAX_DEVICE_ID_LENGTH), MAX_DEVICE_ID_LENGTH); - str.ReleaseBuffer(); -#else - strDeviceName = szDeviceID; -#endif - - return str; -} - -BOOL CAgoraCameraManager::GetDevice(UINT nIndex, CString &rDeviceName, CString &rDeviceID) -{ - CHAR szDeviceName[MAX_DEVICE_ID_LENGTH]; - CHAR szDeviceID[MAX_DEVICE_ID_LENGTH]; - - ASSERT(nIndex < GetDeviceCount()); - if (nIndex >= GetDeviceCount()) - return FALSE; - - if(m_lpCollection == NULL) - return FALSE; - - int nRet = m_lpCollection->getDevice(nIndex, szDeviceName, szDeviceID); - if (nRet != 0) - return FALSE; - -#ifdef UNICODE - ::MultiByteToWideChar(CP_UTF8, 0, szDeviceName, -1, rDeviceName.GetBuffer(MAX_DEVICE_ID_LENGTH), MAX_DEVICE_ID_LENGTH); - ::MultiByteToWideChar(CP_UTF8, 0, szDeviceID, -1, rDeviceID.GetBuffer(MAX_DEVICE_ID_LENGTH), MAX_DEVICE_ID_LENGTH); - - rDeviceName.ReleaseBuffer(); - rDeviceID.ReleaseBuffer(); -#else - strDeviceName = szDeviceName; - strDeviceID = szDeviceID; -#endif - - return TRUE; -} - -BOOL CAgoraCameraManager::SetCurDevice(LPCTSTR lpDeviceID) -{ - if (m_ptrDeviceManager == NULL || *m_ptrDeviceManager == NULL) - return FALSE; - -#ifdef UNICODE - CHAR szDeviceID[128]; - ::WideCharToMultiByte(CP_UTF8, 0, lpDeviceID, -1, szDeviceID, 128, NULL, NULL); - int nRet = (*m_ptrDeviceManager)->setDevice(szDeviceID); -#else - int nRet = (*m_ptrDeviceManager)->setDevice(lpDeviceID); -#endif - - return nRet == 0 ? TRUE : FALSE; -} - -void CAgoraCameraManager::TestCameraDevice(HWND hVideoWnd, BOOL bTestOn) -{ - if (bTestOn && !m_bTestingOn) { - ASSERT(hVideoWnd != NULL); - CAgoraObject::GetAgoraObject()->LocalVideoPreview(hVideoWnd, TRUE); - } - else if(!bTestOn && m_bTestingOn){ - CAgoraObject::GetAgoraObject()->LocalVideoPreview(NULL, FALSE); - } - - m_bTestingOn = bTestOn; -} \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraCameraManager.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraCameraManager.h deleted file mode 100644 index 45c4c71a..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraCameraManager.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once -class CAgoraCameraManager -{ -public: - CAgoraCameraManager(); - ~CAgoraCameraManager(); - - BOOL Create(IRtcEngine *lpRtcEngine); - void Close(); - - UINT GetDeviceCount(); - - CString GetCurDeviceID(); - BOOL SetCurDevice(LPCTSTR lpDeviceID); - - BOOL GetDevice(UINT nIndex, CString &rDeviceName, CString &rDeviceID); - void TestCameraDevice(HWND hVideoWnd, BOOL bTestOn = TRUE); - - BOOL IsTesting() { return m_bTestingOn; }; - -private: - AVideoDeviceManager *m_ptrDeviceManager; - IVideoDeviceCollection *m_lpCollection; - BOOL m_bTestingOn; -}; - diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraObject.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraObject.cpp deleted file mode 100644 index d87f000a..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraObject.cpp +++ /dev/null @@ -1,621 +0,0 @@ -#include "StdAfx.h" -#include "AgoraObject.h" -#include "AGResourceVisitor.h" - -#include - - -CAgoraObject *CAgoraObject::m_lpAgoraObject = NULL; -IRtcEngine *CAgoraObject::m_lpAgoraEngine = NULL; -CAGEngineEventHandler CAgoraObject::m_EngineEventHandler; -CString CAgoraObject::m_strVendorKey; - -CAgoraObject::CAgoraObject(void) - : m_dwEngineFlag(0) - , m_bVideoEnable(FALSE) - , m_bLocalAudioMuted(FALSE) - , m_bScreenCapture(FALSE) - , m_bEchoTest(FALSE) - , m_nSelfUID(0) -{ - m_strChannelName.Empty(); - m_bLocalVideoMuted = FALSE; -} - -CAgoraObject::~CAgoraObject(void) -{ -} - -CString CAgoraObject::LoadAppID() -{ - TCHAR szFilePath[MAX_PATH]; - CString strAppID(APP_ID); - - ::GetModuleFileName(NULL, szFilePath, MAX_PATH); - LPTSTR lpLastSlash = _tcsrchr(szFilePath, _T('\\')); - - if (lpLastSlash == NULL) - return strAppID; - - SIZE_T nNameLen = MAX_PATH - (lpLastSlash - szFilePath + 1); - _tcscpy_s(lpLastSlash + 1, nNameLen, _T("AppID.ini")); - - if (::GetFileAttributes(szFilePath) == INVALID_FILE_ATTRIBUTES) - return strAppID; - - CString strResolution; - - ::GetPrivateProfileString(_T("AppID"), _T("AppID"), NULL, strAppID.GetBuffer(MAX_PATH), MAX_PATH, szFilePath); - - strAppID.ReleaseBuffer(); - - return strAppID; -} - - -CString CAgoraObject::GetSDKVersion() -{ - int nBuildNumber = 0; - const char *lpszEngineVer = getAgoraRtcEngineVersion(&nBuildNumber); - - CString strEngineVer; - -#ifdef UNICODE - ::MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, lpszEngineVer, -1, strEngineVer.GetBuffer(256), 256); - strEngineVer.ReleaseBuffer(); -#endif - - return strEngineVer; -} - -CString CAgoraObject::GetSDKVersionEx() -{ - int nBuildNumber = 0; - const char *lpszEngineVer = getAgoraRtcEngineVersion(&nBuildNumber); - - CString strEngineVer; - CString strVerEx; - SYSTEMTIME sysTime; - -#ifdef UNICODE - ::MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, lpszEngineVer, -1, strEngineVer.GetBuffer(256), 256); - strEngineVer.ReleaseBuffer(); -#else - strEngineVer = lpszEngineVer; -#endif - - ::GetLocalTime(&sysTime); - strVerEx.Format(_T("V%s, Build%d, %d/%d/%d, V%s"), strEngineVer, nBuildNumber, sysTime.wYear, sysTime.wMonth, sysTime.wDay, strEngineVer); - - return strVerEx; -} - -IRtcEngine *CAgoraObject::GetEngine() -{ - if(m_lpAgoraEngine == NULL) - m_lpAgoraEngine = (IRtcEngine *)createAgoraRtcEngine(); - - return m_lpAgoraEngine; -} - -CAgoraObject *CAgoraObject::GetAgoraObject(LPCTSTR lpVendorKey) -{ - if(m_lpAgoraObject == NULL) - m_lpAgoraObject = new CAgoraObject(); - - if(m_lpAgoraEngine == NULL) - m_lpAgoraEngine = (IRtcEngine *)createAgoraRtcEngine(); - - // VendorKeyΪֱӷض - if (lpVendorKey == NULL) - return m_lpAgoraObject; - - RtcEngineContext ctx; - - ctx.eventHandler = &m_EngineEventHandler; - -#ifdef UNICODE - char szVendorKey[128]; - - ::WideCharToMultiByte(CP_ACP, 0, lpVendorKey, -1, szVendorKey, 128, NULL, NULL); - ctx.appId = szVendorKey; -#else - ctx.appId = lpVendorKey; -#endif - - m_lpAgoraEngine->initialize(ctx); - if (lpVendorKey != NULL) - m_strVendorKey = lpVendorKey; - - return m_lpAgoraObject; -} - -void CAgoraObject::CloseAgoraObject() -{ - if(m_lpAgoraEngine != NULL) - m_lpAgoraEngine->release(); - - if(m_lpAgoraObject != NULL) - delete m_lpAgoraObject; - - m_lpAgoraEngine = NULL; - m_lpAgoraObject = NULL; -} - -void CAgoraObject::SetMsgHandlerWnd(HWND hWnd) -{ - m_EngineEventHandler.SetMsgReceiver(hWnd); -} - -HWND CAgoraObject::GetMsgHandlerWnd() -{ - return m_EngineEventHandler.GetMsgReceiver(); -} - - -void CAgoraObject::SetNetworkTestFlag(BOOL bEnable) -{ - if(bEnable) - m_dwEngineFlag |= AG_ENGFLAG_ENNETTEST; - else - m_dwEngineFlag &= (~AG_ENGFLAG_ENNETTEST); -} - -BOOL CAgoraObject::GetNetworkTestFlag() -{ - return (m_dwEngineFlag & AG_ENGFLAG_ENNETTEST) != 0; -} - -void CAgoraObject::SetEchoTestFlag(BOOL bEnable) -{ - if(bEnable) - m_dwEngineFlag |= AG_ENGFLAG_ECHOTEST; - else - m_dwEngineFlag &= (~AG_ENGFLAG_ECHOTEST); -} - -BOOL CAgoraObject::GetEchoTestFlag() -{ - return (m_dwEngineFlag & AG_ENGFLAG_ECHOTEST) != 0; -} - -void CAgoraObject::SetSpeakerphoneTestFlag(BOOL bEnable) -{ - if(bEnable) - m_dwEngineFlag |= AG_ENGFLAG_SPKPHTEST; - else - m_dwEngineFlag &= (~AG_ENGFLAG_SPKPHTEST); -} - -BOOL CAgoraObject::GetSpeakerphoneTestFlag() -{ - return (m_dwEngineFlag & AG_ENGFLAG_SPKPHTEST) != 0; -} - -void CAgoraObject::SetMicrophoneTestFlag(BOOL bEnable) -{ - if(bEnable) - m_dwEngineFlag |= AG_ENGFLAG_MICPHTEST; - else - m_dwEngineFlag &= (~AG_ENGFLAG_MICPHTEST); -} - -BOOL CAgoraObject::GetMicrophoneTestFlag() -{ - return (m_dwEngineFlag & AG_ENGFLAG_MICPHTEST) != 0; -} - - -void CAgoraObject::SetVideoTestFlag(BOOL bEnable) -{ - if (bEnable) - m_dwEngineFlag |= AG_ENGFLAG_VIDEOTEST; - else - m_dwEngineFlag &= (~AG_ENGFLAG_VIDEOTEST); -} - -BOOL CAgoraObject::GetVideoTestFlag() -{ - return (m_dwEngineFlag & AG_ENGFLAG_VIDEOTEST) != 0; -} - -BOOL CAgoraObject::SetLogFilePath(LPCTSTR lpLogPath) -{ - ASSERT(m_lpAgoraEngine != NULL); - - CHAR szLogPathA[MAX_PATH]; - CHAR szLogPathTrans[MAX_PATH]; - - int ret = 0; - RtcEngineParameters rep(*m_lpAgoraEngine); - - if (::GetFileAttributes(lpLogPath) == INVALID_FILE_ATTRIBUTES) { - ::GetModuleFileNameA(NULL, szLogPathA, MAX_PATH); - LPSTR lpLastSlash = strrchr(szLogPathA, '\\')+1; - strcpy_s(lpLastSlash, 64, "AgoraSDK.log"); - } - else { -#ifdef UNICODE - ::WideCharToMultiByte(CP_UTF8, 0, lpLogPath, -1, szLogPathA, MAX_PATH, NULL, NULL); -#else - ::MultiByteToWideChar(CP_UTF8, 0, lpLogPath, -1, (WCHAR *)szLogPathA, MAX_PATH, NULL, NULL); -#endif - } - - CAGResourceVisitor::TransWinPathA(szLogPathA, szLogPathTrans, MAX_PATH); - - ret = rep.setLogFile(szLogPathTrans); - - return ret == 0 ? TRUE : FALSE; -} - -BOOL CAgoraObject::JoinChannel(LPCTSTR lpChannelName, UINT nUID, LPCSTR lpChannelToken) -{ - int nRet = 0; - -// m_lpAgoraEngine->setVideoProfile(VIDEO_PROFILE_720P); -#ifdef UNICODE - CHAR szChannelName[128]; - - ::WideCharToMultiByte(CP_ACP, 0, lpChannelName, -1, szChannelName, 128, NULL, NULL); - nRet = m_lpAgoraEngine->joinChannel(lpChannelToken, szChannelName, NULL, nUID); -#else - nRet = m_lpAgoraEngine->joinChannel(lpChannelToken, lpChannelName, NULL, nUID); -#endif - - if (nRet == 0) - m_strChannelName = lpChannelName; - - return nRet == 0 ? TRUE : FALSE; -} - -BOOL CAgoraObject::LeaveCahnnel() -{ - m_lpAgoraEngine->stopPreview(); - int nRet = m_lpAgoraEngine->leaveChannel(); - - return nRet == 0 ? TRUE : FALSE; -} - -CString CAgoraObject::GetChanelName() -{ - return m_strChannelName; -} - -CString CAgoraObject::GetCallID() -{ - agora::util::AString uid; - CString strUID; - - m_lpAgoraEngine->getCallId(uid); - -#ifdef UNICODE - ::MultiByteToWideChar(CP_ACP, 0, uid->c_str(), -1, strUID.GetBuffer(128), 128); - strUID.ReleaseBuffer(); -#else - strUID = uid->c_str(); -#endif - - return strUID; -} - -BOOL CAgoraObject::EnableVideo(BOOL bEnable) -{ - int nRet = 0; - - if (bEnable) - nRet = m_lpAgoraEngine->enableVideo(); - else - nRet = m_lpAgoraEngine->disableVideo(); - - if (nRet == 0) - m_bVideoEnable = bEnable; - - return nRet == 0 ? TRUE : FALSE; -} - -BOOL CAgoraObject::IsVideoEnabled() -{ - return m_bVideoEnable; -} - -BOOL CAgoraObject::EnableScreenCapture(HWND hWnd, int nCapFPS, LPCRECT lpCapRect, BOOL bEnable, int nBitrate) -{ - ASSERT(m_lpAgoraEngine != NULL); - - int ret = 0; - RtcEngineParameters rep(*m_lpAgoraEngine); - - agora::rtc::Rectangle rcCap; - ScreenCaptureParameters capParam; - capParam.bitrate = nBitrate; - capParam.frameRate = nCapFPS; - - if (bEnable) { - if (lpCapRect == NULL){ - RECT rc; - if (hWnd){ - GetWindowRect(hWnd, &rc); - capParam.dimensions.width = rc.right - rc.left; - capParam.dimensions.height = rc.bottom - rc.top; - ret = m_lpAgoraEngine->startScreenCaptureByWindowId(hWnd, rcCap, capParam); - } - else{ - GetWindowRect(GetDesktopWindow(), &rc); - agora::rtc::Rectangle screenRegion = { rc.left, rc.right, rc.right - rc.left, rc.bottom - rc.top }; - capParam.dimensions.width = rc.right - rc.left; - capParam.dimensions.height = rc.bottom - rc.top; - ret = m_lpAgoraEngine->startScreenCaptureByScreenRect(screenRegion, rcCap, capParam); - } - //startScreenCapture(hWnd, nCapFPS, NULL, nBitrate); - } - else { - capParam.dimensions.width = lpCapRect->right - lpCapRect->left; - capParam.dimensions.height = lpCapRect->bottom - lpCapRect->top; - - rcCap.x = lpCapRect->left; - rcCap.y = lpCapRect->top; - rcCap.width = lpCapRect->right - lpCapRect->left; - rcCap.height = lpCapRect->bottom - lpCapRect->top; - - if (hWnd) - ret = m_lpAgoraEngine->startScreenCaptureByWindowId(hWnd, rcCap, capParam); - else{ - - agora::rtc::Rectangle screenRegion = rcCap; - ret = m_lpAgoraEngine->startScreenCaptureByScreenRect(screenRegion, rcCap, capParam); - } - } - } - else - ret = m_lpAgoraEngine->stopScreenCapture(); - - if (ret == 0) - m_bScreenCapture = bEnable; - - return ret == 0 ? TRUE : FALSE; -} - -BOOL CAgoraObject::IsScreenCaptureEnabled() -{ - return m_bScreenCapture; -} - -BOOL CAgoraObject::MuteLocalAudio(BOOL bMuted) -{ - ASSERT(m_lpAgoraEngine != NULL); - - RtcEngineParameters rep(*m_lpAgoraEngine); - - int ret = rep.muteLocalAudioStream((bool)bMuted); - if (ret == 0) - m_bLocalAudioMuted = bMuted; - - return ret == 0 ? TRUE : FALSE; -} - -BOOL CAgoraObject::IsLocalAudioMuted() -{ - return m_bLocalAudioMuted; -} - - -BOOL CAgoraObject::MuteLocalVideo(BOOL bMuted) -{ - ASSERT(m_lpAgoraEngine != NULL); - - RtcEngineParameters rep(*m_lpAgoraEngine); - - int ret = rep.muteLocalVideoStream((bool)bMuted); - if (ret == 0) - m_bLocalVideoMuted = bMuted; - - return ret == 0 ? TRUE : FALSE; -} - -BOOL CAgoraObject::IsLocalVideoMuted() -{ - return m_bLocalVideoMuted; -} - - -BOOL CAgoraObject::EnableAudioRecording(BOOL bEnable, LPCTSTR lpFilePath) -{ - int ret = 0; - - RtcEngineParameters rep(*m_lpAgoraEngine); - - if (bEnable) { -#ifdef UNICODE - CHAR szFilePath[MAX_PATH]; - ::WideCharToMultiByte(CP_ACP, 0, lpFilePath, -1, szFilePath, MAX_PATH, NULL, NULL); - ret = rep.startAudioRecording(szFilePath, AUDIO_RECORDING_QUALITY_HIGH); -#else - ret = rep.startAudioRecording(lpFilePath); -#endif - } - else - ret = rep.stopAudioRecording(); - - return ret == 0 ? TRUE : FALSE; -} - -BOOL CAgoraObject::EnableNetworkTest(BOOL bEnable) -{ - int ret = 0; - - - if (bEnable) - ret = m_lpAgoraEngine->enableLastmileTest(); - else - ret = m_lpAgoraEngine->disableLastmileTest(); - - return ret == 0 ? TRUE : FALSE; -} - -BOOL CAgoraObject::EnableEchoTest(BOOL bEnable) -{ - int ret = 0; - - if (bEnable) - ret = m_lpAgoraEngine->startEchoTest(); - else - ret = m_lpAgoraEngine->stopEchoTest(); - - if (ret == 0) - m_bEchoTest = bEnable; - - return ret == 0 ? TRUE : FALSE; -} - -BOOL CAgoraObject::LocalVideoPreview(HWND hVideoWnd, BOOL bPreviewOn) -{ - int nRet = 0; - - if (bPreviewOn) { - VideoCanvas vc; - - vc.uid = 0; - vc.view = hVideoWnd; - vc.renderMode = RENDER_MODE_TYPE::RENDER_MODE_HIDDEN; - - m_lpAgoraEngine->setupLocalVideo(vc); - nRet = m_lpAgoraEngine->startPreview(); - } - else - nRet = m_lpAgoraEngine->stopPreview(); - - return nRet == 0 ? TRUE : FALSE; -} - -BOOL CAgoraObject::SetLogFilter(UINT logFilterType, LPCTSTR lpLogPath) -{ - int nRet = 0; - RtcEngineParameters rep(*m_lpAgoraEngine); - - nRet = rep.setLogFilter(logFilterType); - -#ifdef UNICODE - CHAR szFilePath[MAX_PATH]; - ::WideCharToMultiByte(CP_ACP, 0, lpLogPath, -1, szFilePath, MAX_PATH, NULL, NULL); - nRet |= rep.setLogFile(szFilePath); -#else - nRet |= rep.setLogFile(lpLogPath); -#endif - - return nRet == 0 ? TRUE : FALSE; -} - -BOOL CAgoraObject::SetEncryptionSecret(LPCTSTR lpKey, int nEncryptType) -{ - CHAR szUTF8[MAX_PATH]; - -#ifdef UNICODE - ::WideCharToMultiByte(CP_UTF8, 0, lpKey, -1, szUTF8, MAX_PATH, NULL, NULL); -#else - WCHAR szAnsi[MAX_PATH]; - ::MultiByteToWideChar(CP_ACP, 0, lpKey, -1, szAnsi, MAX_PATH); - ::WideCharToMultiByte(CP_UTF8, 0, szAnsi, -1, szUTF8, MAX_PATH, NULL, NULL); -#endif - switch (nEncryptType) - { - case 0: - m_lpAgoraEngine->setEncryptionMode("aes-128-xts"); - break; - case 1: - m_lpAgoraEngine->setEncryptionMode("aes-256-xts"); - break; - default: - m_lpAgoraEngine->setEncryptionMode("aes-128-xts"); - break; - } - int nRet = m_lpAgoraEngine->setEncryptionSecret(szUTF8); - - return nRet == 0 ? TRUE : FALSE; -} - -BOOL CAgoraObject::EnableLocalRender(BOOL bEnable) -{ - int nRet = 0; - -/* if (bEnable) - nRet = m_lpAgoraEngine->setParameters("{\"che.video.local.render\":true}"); - else - nRet = m_lpAgoraEngine->setParameters("{\"che.video.local.render\":false}"); -*/ - return nRet == 0 ? TRUE : FALSE; -} - -int CAgoraObject::CreateMessageStream() -{ - int nDataStream = 0; - m_lpAgoraEngine->createDataStream(&nDataStream, true, true); - - return nDataStream; -} - -BOOL CAgoraObject::SendChatMessage(int nStreamID, LPCTSTR lpChatMessage) -{ - _ASSERT(nStreamID != 0); - int nMessageLen = _tcslen(lpChatMessage); - _ASSERT(nMessageLen < 128); - - CHAR szUTF8[256]; - -#ifdef UNICODE - int nUTF8Len = ::WideCharToMultiByte(CP_UTF8, 0, lpChatMessage, nMessageLen, szUTF8, 256, NULL, NULL); -#else - int nUTF8Len = ::MultiByteToWideChar(CP_UTF8, lpChatMessage, nMessageLen, szUTF8, 256); -#endif - - int nRet = m_lpAgoraEngine->sendStreamMessage(nStreamID, szUTF8, nUTF8Len); - - return nRet == 0 ? TRUE : FALSE; -} - - -BOOL CAgoraObject::EnableWhiteboardVer(BOOL bEnable) -{ - // HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION - HKEY hKey = NULL; - - LSTATUS lStatus = ::RegCreateKeyEx(HKEY_CURRENT_USER, _T("SOFTWARE\\Wow6432Node\\Microsoft\\Internet Explorer\\MAIN\\FeatureControl\\FEATURE_BROWSER_EMULATION"), 0, REG_OPTION_NON_VOLATILE - , REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL); - - if (lStatus != ERROR_SUCCESS) - return FALSE; - - DWORD dwIEVer = 11001; - - if (bEnable) - lStatus = ::RegSetValueEx(hKey, _T("AgoraVideoCall.exe"), 0, REG_DWORD, (const BYTE*)&dwIEVer, sizeof(DWORD)); - else - lStatus = ::RegDeleteKeyValue(hKey, NULL, _T("AgoraVideoCall.exe")); - - ::RegCloseKey(hKey); - - return lStatus == ERROR_SUCCESS ? TRUE : FALSE; -} - -BOOL CAgoraObject::EnableWhiteboardFeq(BOOL bEnable) -{ - // HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION - HKEY hKey = NULL; - - LSTATUS lStatus = ::RegCreateKeyEx(HKEY_CURRENT_USER, _T("SOFTWARE\\Wow6432Node\\Microsoft\\Internet Explorer\\MAIN\\FeatureControl\\FEATURE_MANAGE_SCRIPT_CIRCULAR_REFS"), 0, REG_OPTION_NON_VOLATILE - , REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL); - - if (lStatus != ERROR_SUCCESS) - return FALSE; - - DWORD dwValue = 1; - - if (bEnable) - lStatus = ::RegSetValueEx(hKey, _T("AgoraVideoCall.exe"), 0, REG_DWORD, (const BYTE*)&dwValue, sizeof(DWORD)); - else - lStatus = ::RegDeleteKeyValue(hKey, NULL, _T("AgoraVideoCall.exe")); - - ::RegCloseKey(hKey); - - return lStatus == ERROR_SUCCESS ? TRUE : FALSE; -} \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraObject.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraObject.h deleted file mode 100644 index 0ef9c0e6..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraObject.h +++ /dev/null @@ -1,137 +0,0 @@ -#pragma once - -#include -#include "AGEngineEventHandler.h" - -#define AVC_VER _T("V1.12.0, Build234, 08/14/2017, SDK1.12 .0") - -using namespace agora::rtc; - -// ������λ -#define AG_ENGFLAG_ENNETTEST 0x00000001 -#define AG_ENGFLAG_ECHOTEST 0x00000002 -#define AG_ENGFLAG_SPKPHTEST 0x00000004 -#define AG_ENGFLAG_MICPHTEST 0x00000008 -#define AG_ENGFLAG_VIDEOTEST 0x00000010 - - -#define AG_CODEC_E264 0x00000000 -#define AG_CODEC_EVP 0x00000001 -#define AG_CODEC_VP8 0x00000002 - -/* NOTE: - PLEASE KEEP THIS App ID IN SAFE PLACE - Get your own App ID at https://dashboard.agora.io/ - After you entered the App ID, remove <##> outside of Your App ID - APP_ID _T("") - Obtain a temp Access Token at https://dashboard.agora.io - You will need to deploy your own token server for production release - Leave this value empty if Security keys/Token is not enabled for your project - APP_TOKEN "" -*/ -#define APP_ID _T("") -#define APP_TOKEN "" - -class CAgoraObject -{ -public: - ~CAgoraObject(void); - - static CString LoadAppID(); - - void SetNetworkTestFlag(BOOL bEnable); - BOOL GetNetworkTestFlag(); - - void SetEchoTestFlag(BOOL bEnable); - BOOL GetEchoTestFlag(); - - void SetSpeakerphoneTestFlag(BOOL bEnable); - BOOL GetSpeakerphoneTestFlag(); - - void SetMicrophoneTestFlag(BOOL bEnable); - BOOL GetMicrophoneTestFlag(); - - void SetVideoTestFlag(BOOL bEnable); - BOOL GetVideoTestFlag(); - - void SetMsgHandlerWnd(HWND hWnd); - HWND GetMsgHandlerWnd(); - - BOOL SetLogFilePath(LPCTSTR lpLogPath = NULL); - - BOOL JoinChannel(LPCTSTR lpChannelName, UINT nUID = 0,LPCSTR lpChannelToken = NULL); - BOOL LeaveCahnnel(); - CString GetChanelName(); - CString GetCallID(); - CString GetVendorKey() { return m_strVendorKey; }; - - void SetSelfUID(UINT nUID) { m_nSelfUID = nUID; }; - UINT GetSelfUID() { return m_nSelfUID; }; - - BOOL EnableVideo(BOOL bEnable = TRUE); - BOOL IsVideoEnabled(); - - BOOL EnableScreenCapture(HWND hWnd, int nCapFPS = 15, LPCRECT lpCapRect = NULL, BOOL bEnable = TRUE, int nBitrate = 0); - BOOL IsScreenCaptureEnabled(); - - BOOL MuteLocalAudio(BOOL bMuted = TRUE); - BOOL IsLocalAudioMuted(); - - BOOL MuteLocalVideo(BOOL bMuted = TRUE); - BOOL IsLocalVideoMuted(); - - BOOL EnableAudioRecording(BOOL bEnable, LPCTSTR lpFilePath); - - BOOL EnableNetworkTest(BOOL bEnable); - - BOOL EnableEchoTest(BOOL bEnable = TRUE); - BOOL IsEchoTesting() { return m_bEchoTest; }; - - BOOL LocalVideoPreview(HWND hVideoWnd, BOOL bPreviewOn = TRUE); - - BOOL SetLogFilter(UINT logFilterType, LPCTSTR lpLogPath); - - BOOL SetEncryptionSecret(LPCTSTR lpKey, int nEncryptType = 0); - - BOOL EnableLocalRender(BOOL bEnable); - - int CreateMessageStream(); - BOOL SendChatMessage(int nStreamID, LPCTSTR lpChatMessage); - - static IRtcEngine *GetEngine(); - - static CString GetSDKVersion(); - static CString GetSDKVersionEx(); - - static BOOL EnableWhiteboardVer(BOOL bEnable); - static BOOL EnableWhiteboardFeq(BOOL bEnable); - - - -protected: - CAgoraObject(void); - -private: - DWORD m_dwEngineFlag; - static CAgoraObject *m_lpAgoraObject; - static IRtcEngine *m_lpAgoraEngine; - static CString m_strVendorKey; - - UINT m_nSelfUID; - CString m_strChannelName; - BOOL m_bVideoEnable; - - BOOL m_bLocalAudioMuted; - BOOL m_bLocalVideoMuted; - BOOL m_bEchoTest; - - BOOL m_bScreenCapture; - -// int m_nCodecType; - -public: - static CAgoraObject *GetAgoraObject(LPCTSTR lpVendorKey = NULL); - static void CloseAgoraObject(); - - static CAGEngineEventHandler m_EngineEventHandler; -}; diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraPlayoutManager.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraPlayoutManager.cpp deleted file mode 100644 index 0cacc7f8..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraPlayoutManager.cpp +++ /dev/null @@ -1,167 +0,0 @@ -#include "stdafx.h" -#include "AgoraPlayoutManager.h" -#include "AGResourceVisitor.h" - -CAgoraPlayoutManager::CAgoraPlayoutManager() - : m_ptrDeviceManager(NULL) - , m_lpCollection(NULL) - , m_bTestingOn(FALSE) -{ -} - - -CAgoraPlayoutManager::~CAgoraPlayoutManager() -{ - Close(); -} - -BOOL CAgoraPlayoutManager::Create(IRtcEngine *lpRtcEngine) -{ - m_ptrDeviceManager = new AAudioDeviceManager(lpRtcEngine); - if (m_ptrDeviceManager == NULL || m_ptrDeviceManager->get() == NULL) - return FALSE; - - m_lpCollection = (*m_ptrDeviceManager)->enumeratePlaybackDevices(); - if (m_lpCollection == NULL) { - delete m_ptrDeviceManager; - m_ptrDeviceManager = NULL; - } - - return m_lpCollection != NULL ? TRUE : FALSE; -} - -void CAgoraPlayoutManager::Close() -{ - if (m_lpCollection != NULL){ - m_lpCollection->release(); - m_lpCollection = NULL; - } - - if (m_ptrDeviceManager != NULL) { - delete m_ptrDeviceManager; - m_ptrDeviceManager = NULL; - } -} - -UINT CAgoraPlayoutManager::GetVolume() -{ - int nVol = 0; - - if (m_ptrDeviceManager == NULL || m_ptrDeviceManager->get() == NULL) - return 0; - - (*m_ptrDeviceManager)->getPlaybackDeviceVolume(&nVol); - - return (UINT)nVol; -} - -BOOL CAgoraPlayoutManager::SetVolume(UINT nVol) -{ - if (m_ptrDeviceManager == NULL || m_ptrDeviceManager->get() == NULL) - return 0; - - int nRet = (*m_ptrDeviceManager)->setPlaybackDeviceVolume((int)nVol); - - return nRet == 0 ? TRUE : FALSE; -} - -UINT CAgoraPlayoutManager::GetDeviceCount() -{ - if (m_lpCollection == NULL) - return 0; - - return (UINT)m_lpCollection->getCount(); -} - -BOOL CAgoraPlayoutManager::GetDevice(UINT nIndex, CString &rDeviceName, CString &rDeviceID) -{ - CHAR szDeviceName[MAX_DEVICE_ID_LENGTH]; - CHAR szDeviceID[MAX_DEVICE_ID_LENGTH]; - - ASSERT(nIndex < GetDeviceCount()); - if (nIndex >= GetDeviceCount()) - return FALSE; - - int nRet = m_lpCollection->getDevice(nIndex, szDeviceName, szDeviceID); - if (nRet != 0) - return FALSE; - -#ifdef UNICODE - ::MultiByteToWideChar(CP_UTF8, 0, szDeviceName, -1, rDeviceName.GetBuffer(MAX_DEVICE_ID_LENGTH), MAX_DEVICE_ID_LENGTH); - ::MultiByteToWideChar(CP_UTF8, 0, szDeviceID, -1, rDeviceID.GetBuffer(MAX_DEVICE_ID_LENGTH), MAX_DEVICE_ID_LENGTH); - - rDeviceName.ReleaseBuffer(); - rDeviceID.ReleaseBuffer(); -#else - strDeviceName = szDeviceName; - strDeviceID = szDeviceID; -#endif - - return TRUE; -} - -CString CAgoraPlayoutManager::GetCurDeviceID() -{ - CString str; - CHAR szDeviceID[MAX_DEVICE_ID_LENGTH]; - - if (m_ptrDeviceManager == NULL || m_ptrDeviceManager->get() == NULL) - return str; - - (*m_ptrDeviceManager)->getPlaybackDevice(szDeviceID); - -#ifdef UNICODE - ::MultiByteToWideChar(CP_UTF8, 0, szDeviceID, -1, str.GetBuffer(MAX_DEVICE_ID_LENGTH), MAX_DEVICE_ID_LENGTH); - str.ReleaseBuffer(); -#else - strDeviceName = szDeviceID; -#endif - - return str; -} - -BOOL CAgoraPlayoutManager::SetCurDevice(LPCTSTR lpDeviceID) -{ - if (m_ptrDeviceManager == NULL || m_ptrDeviceManager->get() == NULL) - return FALSE; - -#ifdef UNICODE - CHAR szDeviceID[128]; - ::WideCharToMultiByte(CP_ACP, 0, lpDeviceID, -1, szDeviceID, 128, NULL, NULL); - int nRet = (*m_ptrDeviceManager)->setPlaybackDevice(szDeviceID); -#else - int nRet = (*m_ptrDeviceManager)->setPlaybackDevice(lpDeviceID); -#endif - - return nRet == 0 ? TRUE : FALSE; -} - -void CAgoraPlayoutManager::TestPlaybackDevice(UINT nWavID, BOOL bTestOn) -{ - TCHAR szWavPath[MAX_PATH]; - - if (m_ptrDeviceManager == NULL || m_ptrDeviceManager->get() == NULL) - return; - - ::GetModuleFileName(NULL, szWavPath, MAX_PATH); - LPTSTR lpLastSlash = (LPTSTR)_tcsrchr(szWavPath, _T('\\')) + 1; - _tcscpy_s(lpLastSlash, 16, _T("test.wav")); - - if (bTestOn && !m_bTestingOn) { - CAGResourceVisitor::SaveResourceToFile(_T("WAVE"), nWavID, szWavPath); - -#ifdef UNICODE - CHAR szWavPathA[MAX_PATH]; - - ::WideCharToMultiByte(CP_ACP, 0, szWavPath, -1,szWavPathA , MAX_PATH, NULL, NULL); - (*m_ptrDeviceManager)->startPlaybackDeviceTest(szWavPathA); -#else - (*m_ptrDeviceManager)->startPlaybackDeviceTest(szWavPathA); -#endif - } - else if (!bTestOn && m_bTestingOn) - (*m_ptrDeviceManager)->stopPlaybackDeviceTest(); - - m_bTestingOn = bTestOn; - -} \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraPlayoutManager.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraPlayoutManager.h deleted file mode 100644 index fe446b75..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/AgoraPlayoutManager.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once -class CAgoraPlayoutManager -{ -public: - CAgoraPlayoutManager(); - ~CAgoraPlayoutManager(); - - BOOL Create(IRtcEngine *lpRtcEngine); - void Close(); - - UINT GetVolume(); - BOOL SetVolume(UINT nVol); - UINT GetDeviceCount(); - - CString GetCurDeviceID(); - BOOL SetCurDevice(LPCTSTR lpDeviceID); - - BOOL GetDevice(UINT nIndex, CString &rDeviceName, CString &rDeviceID); - void TestPlaybackDevice(UINT nWavID, BOOL bTestOn = TRUE); - - BOOL IsTesting() { return m_bTestingOn; }; -private: - AAudioDeviceManager *m_ptrDeviceManager; - IAudioDeviceCollection *m_lpCollection; - -private: - BOOL m_bTestingOn; -}; - diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/ChatDlg.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/ChatDlg.cpp deleted file mode 100644 index 99d9a260..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/ChatDlg.cpp +++ /dev/null @@ -1,129 +0,0 @@ -// ChatDlg.cpp : ʵļ -// - -#include "stdafx.h" -#include "OpenVideoCall.h" -#include "ChatDlg.h" -#include "afxdialogex.h" - - -// CChatDlg Ի - -IMPLEMENT_DYNAMIC(CChatDlg, CDialogEx) - -CChatDlg::CChatDlg(CWnd* pParent /*=NULL*/) - : CDialogEx(CChatDlg::IDD, pParent) -{ - -} - -CChatDlg::~CChatDlg() -{ -} - -void CChatDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialogEx::DoDataExchange(pDX); - DDX_Control(pDX, IDC_EDCHAT_MESSAGE, m_edtChatBox); -} - - -BEGIN_MESSAGE_MAP(CChatDlg, CDialogEx) - ON_WM_SIZE() - ON_WM_PAINT() -END_MESSAGE_MAP() - - -// CChatDlg Ϣ - - -BOOL CChatDlg::OnInitDialog() -{ - CDialogEx::OnInitDialog(); - - // TODO: ڴӶijʼ - LONG lExStyle = ::GetWindowLong(GetSafeHwnd(), GWL_EXSTYLE); - ::SetWindowLong(GetSafeHwnd(), GWL_EXSTYLE, lExStyle | WS_EX_LAYERED); - - SetBackgroundColor(RGB(0, 0, 0)); - SetLayeredWindowAttributes(0, 130, LWA_ALPHA); - m_nStreamID = CAgoraObject::GetAgoraObject()->CreateMessageStream(); - - return TRUE; // return TRUE unless you set the focus to a control - // 쳣: OCX ҳӦ FALSE -} - -void CChatDlg::OnSize(UINT nType, int cx, int cy) -{ - CDialogEx::OnSize(nType, cx, cy); - - // TODO: ڴ˴Ϣ - if (::IsWindow(m_edtChatBox.GetSafeHwnd())) - m_edtChatBox.MoveWindow(1, cy - 21, cx - 2, 20); -} - - -BOOL CChatDlg::PreTranslateMessage(MSG* pMsg) -{ - // TODO: ڴרô/û - CString str; - - if (pMsg->message == WM_KEYDOWN){ - if (pMsg->wParam == VK_RETURN) { - m_edtChatBox.GetWindowText(str); - if (str.GetLength() > 0) { - CAgoraObject::GetAgoraObject()->SendChatMessage(m_nStreamID, str); - AddChatMessage(0, str); - m_edtChatBox.SetWindowText(_T("")); - } - } - - return FALSE; - } - - return CDialogEx::PreTranslateMessage(pMsg); -} - - -void CChatDlg::OnPaint() -{ - CPaintDC dc(this); // device context for painting - // TODO: ڴ˴Ϣ - // ΪͼϢ CDialogEx::OnPaint() - - int y = 100; - - POSITION pos = m_strMsgList.GetHeadPosition(); - dc.SetTextColor(RGB(0xFF, 0xFF, 0xFF)); - dc.SetBkColor(RGB(0, 0, 0)); - - while (pos != NULL) { - CString str = m_strMsgList.GetNext(pos); - dc.TextOut(20, y, str); - y -= 20; - } -} - -void CChatDlg::AddChatMessage(UINT nUID, LPCTSTR lpMessage) -{ - CString str; - - if (nUID != 0) - str.Format(_T("%d: %s"), nUID, lpMessage); - else - str.Format(_T("me: %s"), lpMessage); - - if (m_strMsgList.GetCount() >= 5) - m_strMsgList.RemoveTail(); - - m_strMsgList.AddHead(str); - - Invalidate(TRUE); -} - -void CChatDlg::ClearHistory() -{ - m_strMsgList.RemoveAll(); - - Invalidate(TRUE); -} \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/ChatDlg.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/ChatDlg.h deleted file mode 100644 index 2d931dcc..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/ChatDlg.h +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once -#include "afxwin.h" -#include - -// CChatDlg Ի - -class CChatDlg : public CDialogEx -{ - DECLARE_DYNAMIC(CChatDlg) - -public: - CChatDlg(CWnd* pParent = NULL); // ׼캯 - virtual ~CChatDlg(); - -// Ի - enum { IDD = IDD_MESSAGE_DIALOG }; - - void AddChatMessage(UINT nUID, LPCTSTR lpMessage); - void ClearHistory(); - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ - virtual BOOL OnInitDialog(); - virtual BOOL PreTranslateMessage(MSG* pMsg); - - afx_msg void OnPaint(); - afx_msg void OnSize(UINT nType, int cx, int cy); - - DECLARE_MESSAGE_MAP() - - -private: - CEdit m_edtChatBox; - - CStringList m_strMsgList; - int m_nStreamID; -}; diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/DeviceDlg.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/DeviceDlg.cpp deleted file mode 100644 index a80de87c..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/DeviceDlg.cpp +++ /dev/null @@ -1,385 +0,0 @@ -// DeviceDlg.cpp : ʵļ -// - -#include "stdafx.h" -#include "OpenVideoCall.h" -#include "DeviceDlg.h" -#include "afxdialogex.h" - - -// CDeviceDlg Ի - -IMPLEMENT_DYNAMIC(CDeviceDlg, CDialogEx) - -CDeviceDlg::CDeviceDlg(CWnd* pParent /*=NULL*/) - : CDialogEx(CDeviceDlg::IDD, pParent) -{ - -} - -CDeviceDlg::~CDeviceDlg() -{ -} - -void CDeviceDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialogEx::DoDataExchange(pDX); - - DDX_Control(pDX, IDC_BTNCANCEL_DEVICE, m_btnCancel); - DDX_Control(pDX, IDC_BTNCONFIRM_DEVICE, m_btnConfirm); - - DDX_Control(pDX, IDC_SLDAIN_DEVICE, m_sldAInVol); - DDX_Control(pDX, IDC_SLDAOUT_DEVICE, m_sldAOutVol); - DDX_Control(pDX, IDC_SLKAIN_DEVICE, m_slkAudInTest); - DDX_Control(pDX, IDC_SLKAOUT_DEVICE, m_slkAudOutTest); - DDX_Control(pDX, IDC_SLKCAM_DEVICE, m_slkCamTest); - DDX_Control(pDX, IDC_SLKECHO_DEVICE, m_slkEchoTest); -} - - -BEGIN_MESSAGE_MAP(CDeviceDlg, CDialogEx) - ON_WM_PAINT() - ON_WM_SHOWWINDOW() - ON_BN_CLICKED(IDC_BTNCANCEL_DEVICE, &CDeviceDlg::OnBnClickedBtncancelDevice) - ON_BN_CLICKED(IDC_BTNCONFIRM_DEVICE, &CDeviceDlg::OnBnClickedBtnconfirmDevice) - ON_MESSAGE(WM_MSGID(EID_AUDIO_VOLUME_INDICATION), &CDeviceDlg::OnEIDAudioVolumeIndication) - - ON_STN_CLICKED(IDC_SLKAIN_DEVICE, &CDeviceDlg::OnStnClickedSlkainDevice) - ON_STN_CLICKED(IDC_SLKAOUT_DEVICE, &CDeviceDlg::OnStnClickedSlkaoutDevice) - ON_STN_CLICKED(IDC_SLKCAM_DEVICE, &CDeviceDlg::OnStnClickedSlkcamDevice) - ON_STN_CLICKED(IDC_SLKECHO_DEVICE, &CDeviceDlg::OnStnClickedSlkechoDevice) - -END_MESSAGE_MAP() - - -// CDeviceDlg Ϣ -void CDeviceDlg::OnPaint() -{ - CPaintDC dc(this); - - DrawClient(&dc); -} - -BOOL CDeviceDlg::OnInitDialog() -{ - CDialogEx::OnInitDialog(); - - // TODO: ڴӶijʼ - m_lpRtcEngine = CAgoraObject::GetEngine(); - - m_ftDes.CreateFont(15, 0, 0, 0, FW_NORMAL, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, _T("Arial")); - m_ftLink.CreateFont(17, 0, 0, 0, FW_NORMAL, FALSE, TRUE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, _T("Arial")); - m_ftBtn.CreateFont(16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, _T("Arial")); - - m_wndVideoTest.Create(NULL, NULL, WS_CHILD | WS_VISIBLE, CRect(0, 0, 300, 40), this, IDC_VIDEOTEST_DEVICE); - m_wndVideoTest.SetVolRange(100); - - m_cbxAIn.Create(WS_CHILD | WS_VISIBLE, CRect(0, 0, 300, 40), this, IDC_CMBAIN_DEVICE); - m_cbxAOut.Create(WS_CHILD | WS_VISIBLE, CRect(0, 0, 300, 40), this, IDC_CMBAOUT_DEVICE); - m_cbxCam.Create(WS_CHILD | WS_VISIBLE, CRect(0, 0, 300, 40), this, IDC_CMBCAM_DEVICE); - m_penFrame.CreatePen(PS_SOLID, 1, RGB(0xD8, 0xD8, 0xD8)); - - SetBackgroundColor(RGB(0xFF, 0xFF, 0xFF), TRUE); - InitCtrls(); - - return TRUE; // return TRUE unless you set the focus to a control - // 쳣: OCX ҳӦ FALSE -} - -void CDeviceDlg::EnableDeviceTest(BOOL bEnable) -{ - m_slkAudInTest.EnableWindow(bEnable); - m_slkAudOutTest.EnableWindow(bEnable); - m_slkCamTest.EnableWindow(bEnable); -} - -void CDeviceDlg::InitCtrls() -{ - CRect ClientRect; - - MoveWindow(0, 0, 512, 640, 1); - CenterWindow(); - - GetClientRect(&ClientRect); - - m_cbxAIn.SetFaceColor(RGB(0xFF, 0xFF, 0xFF), RGB(0xFF, 0xFF, 0xFF)); - m_cbxAIn.MoveWindow(160, 65, 215, 22, TRUE); - m_cbxAOut.SetFaceColor(RGB(0xFF, 0xFF, 0xFF), RGB(0xFF, 0xFF, 0xFF)); - m_cbxAOut.MoveWindow(160, 195, 215, 22, TRUE); - m_cbxCam.SetFaceColor(RGB(0xFF, 0xFF, 0xFF), RGB(0xFF, 0xFF, 0xFF)); - m_cbxCam.MoveWindow(160, 325, 215, 22, TRUE); - m_sldAInVol.MoveWindow(155, 110, 285, 24, TRUE); - m_sldAOutVol.MoveWindow(155, 245, 285, 24, TRUE); - m_wndVideoTest.MoveWindow(155, 378, 192, 120, TRUE); - - m_slkAudInTest.SetFont(&m_ftLink); - m_slkAudInTest.MoveWindow(405, 65, 72, 40, TRUE); - m_slkAudOutTest.SetFont(&m_ftLink); - m_slkAudOutTest.MoveWindow(405, 200, 72, 40, TRUE); - m_slkCamTest.SetFont(&m_ftLink); - m_slkCamTest.MoveWindow(405, 325, 72, 40, TRUE); - m_slkEchoTest.SetFont(&m_ftLink); - m_slkEchoTest.MoveWindow(405, 425, 72, 40, TRUE); - - m_btnCancel.MoveWindow(66, ClientRect.Height() - 88, 180, 36, TRUE); -// m_btnCancel.EnableRoundCorner(TRUE); - - m_btnConfirm.MoveWindow(266, ClientRect.Height() - 88, 180, 36, TRUE); -// m_btnConfirm.EnableRoundCorner(TRUE); - - m_cbxAIn.SetButtonImage(IDB_CMBBTN, 12, 12, RGB(0xFF, 0x00, 0xFF)); - m_cbxAOut.SetButtonImage(IDB_CMBBTN, 12, 12, RGB(0xFF, 0x00, 0xFF)); - m_cbxCam.SetButtonImage(IDB_CMBBTN, 12, 12, RGB(0xFF, 0x00, 0xFF)); - m_cbxAIn.SetFont(&m_ftDes); - m_cbxAOut.SetFont(&m_ftDes); - m_cbxCam.SetFont(&m_ftDes); - - m_slkAudInTest.SetWindowText(LANG_STR("IDS_DEVICE_BTNTEST")); - m_slkAudOutTest.SetWindowText(LANG_STR("IDS_DEVICE_BTNTEST")); - m_slkCamTest.SetWindowText(LANG_STR("IDS_DEVICE_BTNTEST")); - - m_btnCancel.SetBorderColor(RGB(0xD8, 0xD8, 0xD8), RGB(0x00, 0xA0, 0xE9), RGB(0x00, 0xA0, 0xE9), RGB(0xCC, 0xCC, 0xCC)); - m_btnCancel.SetBackColor(RGB(0xFF, 0xFF, 0xFF), RGB(0xFF, 0xFF, 0xFF), RGB(0xFF, 0xFF, 0xFF), RGB(0xFF, 0xFF, 0xFF)); - m_btnCancel.SetFont(&m_ftBtn); - m_btnCancel.SetTextColor(RGB(0x55, 0x58, 0x5A), RGB(0x00, 0xA0, 0xE9), RGB(0x00, 0xA0, 0xE9), RGB(0xCC, 0xCC, 0xCC)); - m_btnCancel.SetWindowText(LANG_STR("IDS_DEVICE_CANCEL")); - - m_btnConfirm.SetBackColor(RGB(0x00, 0xA0, 0xE9), RGB(0x05, 0x78, 0xAA), RGB(0x05, 0x78, 0xAA), RGB(0xE6, 0xE6, 0xE6)); - m_btnConfirm.SetFont(&m_ftBtn); - m_btnConfirm.SetTextColor(RGB(0xFF, 0xFF, 0xFF), RGB(0xFF, 0xFF, 0xFF), RGB(0xFF, 0xFF, 0xFF), RGB(0xCC, 0xCC, 0xCC)); - m_btnConfirm.SetWindowText(LANG_STR("IDS_DEVICE_CONFIRM")); - - m_sldAInVol.SetThumbBitmap(IDB_SLDTHUMB_NORMAL, IDB_SLDTHUMB_HOT, IDB_SLDTHUMB_HOT, RGB(0xFF, 0, 0xFF)); - m_sldAInVol.SetRange(0, 255); - - m_sldAOutVol.SetThumbBitmap(IDB_SLDTHUMB_NORMAL, IDB_SLDTHUMB_HOT, IDB_SLDTHUMB_HOT, RGB(0xFF, 0, 0xFF)); - m_sldAOutVol.SetRange(0, 255); -} - -void CDeviceDlg::DrawClient(CDC *lpDC) -{ - CRect rcText; - CRect rcClient; - LPCTSTR lpString = NULL; - - GetClientRect(&rcClient); - - CFont* defFont = lpDC->SelectObject(&m_ftDes); - lpDC->SetBkColor(RGB(0xFF, 0xFF, 0xFF)); - lpDC->SetTextColor(RGB(0xD8, 0xD8, 0xD8)); - - lpDC->SelectObject(&m_penFrame); - rcText.SetRect(rcClient.Width() / 2 - 190, 60, rcClient.Width() / 2 + 130, 92); - lpDC->RoundRect(&rcText, CPoint(32, 32)); - lpString = LANG_STR("IDS_DEVICE_AUDIOIN"); - lpDC->TextOut(80, 69, lpString, _tcslen(lpString)); - - rcText.SetRect(rcClient.Width() / 2 - 190, 190, rcClient.Width() / 2 + 130, 222); - lpDC->RoundRect(&rcText, CPoint(32, 32)); - lpString = LANG_STR("IDS_DEVICE_AUDIOOUT"); - lpDC->TextOut(80, 199, lpString, _tcslen(lpString)); - - rcText.SetRect(rcClient.Width() / 2 - 190, 320, rcClient.Width() / 2 + 130, 352); - lpDC->RoundRect(&rcText, CPoint(32, 32)); - lpString = LANG_STR("IDS_DEVICE_CAMERA"); - lpDC->TextOut(80, 329, lpString, _tcslen(lpString)); - - lpString = LANG_STR("IDS_DEVICE_VOLUME"); - lpDC->SetTextColor(RGB(0x00, 0x00, 0x00)); - lpDC->TextOut(66, 115, lpString, _tcslen(lpString)); - lpDC->TextOut(66, 250, lpString, _tcslen(lpString)); - - lpDC->SelectObject(defFont); -} - -void CDeviceDlg::OnShowWindow(BOOL bShow, UINT nStatus) -{ - CDialogEx::OnShowWindow(bShow, nStatus); - - // TODO: ڴ˴Ϣ - if (!bShow) { - m_agPlayout.Close(); - m_agAudioin.Close(); - m_agCamera.Close(); - - CAgoraObject::GetAgoraObject()->EnableEchoTest(FALSE); - m_slkEchoTest.SetWindowText(_T("EchoTest")); - - return; - } - - CString strDeviceName; - CString strDeviceID; - CString strCurID; - - m_agPlayout.Create(m_lpRtcEngine); - m_agAudioin.Create(m_lpRtcEngine); - m_agCamera.Create(m_lpRtcEngine); - - m_sldAOutVol.SetPos(m_agPlayout.GetVolume()); - m_sldAInVol.SetPos(m_agAudioin.GetVolume()); - - m_cbxAOut.ResetContent(); - strCurID = m_agPlayout.GetCurDeviceID(); - for (UINT nIndex = 0; nIndex < m_agPlayout.GetDeviceCount(); nIndex++){ - m_agPlayout.GetDevice(nIndex, strDeviceName, strDeviceID); - m_cbxAOut.InsertString(nIndex, strDeviceName); - - if (strCurID == strDeviceID) - m_cbxAOut.SetCurSel(nIndex); - } - - m_cbxAIn.ResetContent(); - strCurID = m_agAudioin.GetCurDeviceID(); - for (UINT nIndex = 0; nIndex < m_agAudioin.GetDeviceCount(); nIndex++){ - m_agAudioin.GetDevice(nIndex, strDeviceName, strDeviceID); - m_cbxAIn.InsertString(nIndex, strDeviceName); - - if (strCurID == strDeviceID) - m_cbxAIn.SetCurSel(nIndex); - } - - m_cbxCam.ResetContent(); - strCurID = m_agCamera.GetCurDeviceID(); - for (UINT nIndex = 0; nIndex < m_agCamera.GetDeviceCount(); nIndex++){ - m_agCamera.GetDevice(nIndex, strDeviceName, strDeviceID); - m_cbxCam.InsertString(nIndex, strDeviceName); - - if (strCurID == strDeviceID) - m_cbxCam.SetCurSel(nIndex); - } -} - - -BOOL CDeviceDlg::PreTranslateMessage(MSG* pMsg) -{ - // TODO: ڴרô/û - if (pMsg->message == WM_KEYDOWN){ - switch (pMsg->wParam){ - case VK_ESCAPE: - OnBnClickedBtncancelDevice(); - return FALSE; - case VK_RETURN: - OnBnClickedBtnconfirmDevice(); - return FALSE; - } - } - - return CDialogEx::PreTranslateMessage(pMsg); -} - - -void CDeviceDlg::OnBnClickedBtncancelDevice() -{ - // TODO: ڴӿؼ֪ͨ - m_agAudioin.TestAudInputDevice(NULL, FALSE); - m_slkAudInTest.SetWindowText(LANG_STR("IDS_DEVICE_BTNTEST")); - - m_agPlayout.TestPlaybackDevice(ID_TEST_AUDIO, FALSE); - m_slkAudOutTest.SetWindowText(LANG_STR("IDS_DEVICE_BTNTEST")); - - m_agCamera.TestCameraDevice(NULL, FALSE); - m_slkCamTest.SetWindowText(LANG_STR("IDS_DEVICE_BTNTEST")); - - CDialogEx::OnCancel(); -} - - -void CDeviceDlg::OnBnClickedBtnconfirmDevice() -{ - // TODO: ڴӿؼ֪ͨ - int nCurSel = 0; - CString strDeviceName; - CString strDeviceID; - - m_agAudioin.SetVolume(m_sldAInVol.GetPos()); - m_agPlayout.SetVolume(m_sldAOutVol.GetPos()); - - m_agAudioin.TestAudInputDevice(NULL, FALSE); - m_slkAudInTest.SetWindowText(LANG_STR("IDS_DEVICE_BTNTEST")); - nCurSel = m_cbxAIn.GetCurSel(); - if (nCurSel != -1) { - m_agAudioin.GetDevice(nCurSel, strDeviceName, strDeviceID); - m_agAudioin.SetCurDevice(strDeviceID); - } - - - m_agPlayout.TestPlaybackDevice(ID_TEST_AUDIO, FALSE); - m_slkAudOutTest.SetWindowText(LANG_STR("IDS_DEVICE_BTNTEST")); - nCurSel = m_cbxAOut.GetCurSel(); - if (nCurSel != -1) { - m_agPlayout.GetDevice(nCurSel, strDeviceName, strDeviceID); - m_agPlayout.SetCurDevice(strDeviceID); - } - - m_agCamera.TestCameraDevice(NULL, FALSE); - m_slkCamTest.SetWindowText(LANG_STR("IDS_DEVICE_BTNTEST")); - nCurSel = m_cbxCam.GetCurSel(); - if (nCurSel != -1) { - m_agCamera.GetDevice(nCurSel, strDeviceName, strDeviceID); - m_agCamera.SetCurDevice(strDeviceID); - } - - CDialogEx::OnOK(); -} - -LRESULT CDeviceDlg::OnEIDAudioVolumeIndication(WPARAM wParam, LPARAM lParam) -{ - LPAGE_AUDIO_VOLUME_INDICATION lpData = (LPAGE_AUDIO_VOLUME_INDICATION)wParam; - m_wndVideoTest.SetCurVol(lpData->totalVolume); - - delete lpData; - - return 0; -} - -void CDeviceDlg::OnStnClickedSlkainDevice() -{ - // TODO: ڴӿؼ֪ͨ - if (m_agAudioin.IsTesting()) { - m_agAudioin.TestAudInputDevice(NULL, FALSE); - m_slkAudInTest.SetWindowText(LANG_STR("IDS_DEVICE_BTNTEST")); - } - else { - m_agAudioin.TestAudInputDevice(GetSafeHwnd(), TRUE); - m_slkAudInTest.SetWindowText(LANG_STR("IDS_DEVICE_BTNTESTOFF")); - } -} - -void CDeviceDlg::OnStnClickedSlkaoutDevice() -{ - if (m_agPlayout.IsTesting()) { - m_agPlayout.TestPlaybackDevice(ID_TEST_AUDIO, FALSE); - m_slkAudOutTest.SetWindowText(LANG_STR("IDS_DEVICE_BTNTEST")); - } - else { - m_agPlayout.TestPlaybackDevice(ID_TEST_AUDIO, TRUE); - m_slkAudOutTest.SetWindowText(LANG_STR("IDS_DEVICE_BTNTESTOFF")); - } -} - -void CDeviceDlg::OnStnClickedSlkcamDevice() -{ - if (m_agCamera.IsTesting()) { - m_agCamera.TestCameraDevice(NULL, FALSE); - m_slkCamTest.SetWindowText(LANG_STR("IDS_DEVICE_BTNTEST")); - } - else { - m_agCamera.TestCameraDevice(m_wndVideoTest.GetVideoSafeHwnd(), TRUE); - m_slkCamTest.SetWindowText(LANG_STR("IDS_DEVICE_BTNTESTOFF")); - } -} - -void CDeviceDlg::OnStnClickedSlkechoDevice() -{ - CAgoraObject *lpAgoraObject = CAgoraObject::GetAgoraObject(); - - if (lpAgoraObject->IsEchoTesting()) { - lpAgoraObject->EnableEchoTest(FALSE); - m_slkEchoTest.SetWindowText(_T("EchoTest")); - } - else{ - lpAgoraObject->EnableEchoTest(TRUE); - m_slkEchoTest.SetWindowText(_T("StopEcho")); - } -} \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/DeviceDlg.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/DeviceDlg.h deleted file mode 100644 index a8a74a26..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/DeviceDlg.h +++ /dev/null @@ -1,82 +0,0 @@ -#pragma once -#include "AGButton.h" -#include "AGComboBox.h" -#include "AGSliderCtrl.h" -#include "AGLinkCtrl.h" -#include "AGVideoTestWnd.h" - -#include "AgoraPlayoutManager.h" -#include "AgoraAudInputManager.h" -#include "AgoraCameraManager.h" - -// CDeviceDlg Ի - -class CDeviceDlg : public CDialogEx -{ - DECLARE_DYNAMIC(CDeviceDlg) - -public: - CDeviceDlg(CWnd* pParent = NULL); // ׼캯 - virtual ~CDeviceDlg(); - -// Ի - enum { IDD = IDD_DEVICE_DIALOG }; - - void EnableDeviceTest(BOOL bEnable); - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ - virtual BOOL OnInitDialog(); - virtual BOOL PreTranslateMessage(MSG* pMsg); - - afx_msg void OnPaint(); - afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); - - afx_msg void OnStnClickedSlkainDevice(); - afx_msg void OnStnClickedSlkaoutDevice(); - afx_msg void OnStnClickedSlkcamDevice(); - afx_msg void OnStnClickedSlkechoDevice(); - - afx_msg void OnBnClickedBtncancelDevice(); - afx_msg void OnBnClickedBtnconfirmDevice(); - - afx_msg LRESULT OnEIDAudioVolumeIndication(WPARAM wParam, LPARAM lParam); - - DECLARE_MESSAGE_MAP() - -protected: - void InitCtrls(); - void DrawClient(CDC *lpDC); - - -private: - CFont m_ftLink; - CFont m_ftDes; // text in ctrl - CFont m_ftBtn; // button - - CPen m_penFrame; - CAGComboBox m_cbxAIn; - CAGComboBox m_cbxAOut; - CAGComboBox m_cbxCam; - - CAGLinkCtrl m_slkAudInTest; - CAGLinkCtrl m_slkAudOutTest; - CAGLinkCtrl m_slkCamTest; - CAGLinkCtrl m_slkEchoTest; - - CAGSliderCtrl m_sldAInVol; - CAGSliderCtrl m_sldAOutVol; - - CAGButton m_btnCancel; - CAGButton m_btnConfirm; - - CAGVideoTestWnd m_wndVideoTest; - -private: - IRtcEngine *m_lpRtcEngine; - CAgoraPlayoutManager m_agPlayout; - CAgoraAudInputManager m_agAudioin; - CAgoraCameraManager m_agCamera; - -public: -}; diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/DskcapsetDlg.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/DskcapsetDlg.cpp deleted file mode 100644 index 465b476e..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/DskcapsetDlg.cpp +++ /dev/null @@ -1,120 +0,0 @@ -// DskcapsetDlg.cpp : ʵļ -// - -#include "stdafx.h" -#include "OpenVideoCall.h" -#include "DskcapsetDlg.h" -#include "afxdialogex.h" - - -// CDskcapsetDlg Ի - -IMPLEMENT_DYNAMIC(CDskcapsetDlg, CDialogEx) - -CDskcapsetDlg::CDskcapsetDlg(CWnd* pParent /*=NULL*/) - : CDialogEx(CDskcapsetDlg::IDD, pParent) - , m_nBitrate(0) -{ - -} - -CDskcapsetDlg::~CDskcapsetDlg() -{ -} - -void CDskcapsetDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialogEx::DoDataExchange(pDX); - DDX_Control(pDX, IDC_CMBFRMRATE_TB, m_cbxCaptureFPS); -} - - -BEGIN_MESSAGE_MAP(CDskcapsetDlg, CDialogEx) - ON_WM_SHOWWINDOW() -END_MESSAGE_MAP() - - -// CDskcapsetDlg Ϣ - -int CDskcapsetDlg::GetCaptureFPS() -{ - int nSel = m_cbxCaptureFPS.GetCurSel(); - - if (nSel == -1) - return 15; - - return nSel + 1; -} - -void CDskcapsetDlg::SetCaptureRect(LPCRECT lpRect) -{ - ASSERT(lpRect->left != lpRect->right); - ASSERT(lpRect->top != lpRect->bottom); - - if (lpRect->left == lpRect->right || lpRect->top == lpRect->bottom) - return; - - m_rcRegion.CopyRect(lpRect); - - CString str; - str.Format(_T("\nleft:%d,top:%d, right:%d, bottom:%d\n"), lpRect->left, lpRect->top, lpRect->right, lpRect->bottom); - OutputDebugString(str); - SetDlgItemInt(IDC_EDX_TB, m_rcRegion.left); - SetDlgItemInt(IDC_EDY_TB, m_rcRegion.top); - SetDlgItemInt(IDC_EDW_TB, m_rcRegion.Width()); - SetDlgItemInt(IDC_EDH_TB, m_rcRegion.Height()); -} - -void CDskcapsetDlg::GetCaptureRect(LPRECT lpRect) -{ - lpRect->left = m_rcRegion.left; - lpRect->right = m_rcRegion.right; - lpRect->top = m_rcRegion.top; - lpRect->bottom = m_rcRegion.bottom; - - int bitrate = GetDlgItemInt(IDC_EDBITRATE_TB, NULL, TRUE); - if (bitrate > 0) - m_nBitrate = bitrate; - m_rcRegion.left = GetDlgItemInt(IDC_EDX_TB, NULL, TRUE); - m_rcRegion.top = GetDlgItemInt(IDC_EDY_TB, NULL, TRUE); - m_rcRegion.right = m_rcRegion.left + GetDlgItemInt(IDC_EDW_TB, NULL, TRUE); - m_rcRegion.bottom = m_rcRegion.top + GetDlgItemInt(IDC_EDH_TB, NULL, TRUE); -} - -BOOL CDskcapsetDlg::OnInitDialog() -{ - CDialogEx::OnInitDialog(); - - // TODO: ڴӶijʼ - CString str; - for (int nIndex = 0; nIndex < 15; nIndex++) { - str.Format(_T("%d fps"), nIndex + 1); - m_cbxCaptureFPS.InsertString(nIndex, str); - } - m_cbxCaptureFPS.SetCurSel(14); - - return TRUE; // return TRUE unless you set the focus to a control - // 쳣: OCX ҳӦ FALSE -} - - -void CDskcapsetDlg::OnShowWindow(BOOL bShow, UINT nStatus) -{ - CDialogEx::OnShowWindow(bShow, nStatus); - - // TODO: ڴ˴Ϣ - - if (!bShow) { - m_nBitrate = GetDlgItemInt(IDC_EDBITRATE_TB, NULL, TRUE); - m_rcRegion.left = GetDlgItemInt(IDC_EDX_TB, NULL, TRUE); - m_rcRegion.top = GetDlgItemInt(IDC_EDY_TB, NULL, TRUE); - m_rcRegion.right = m_rcRegion.left + GetDlgItemInt(IDC_EDW_TB, NULL, TRUE); - m_rcRegion.bottom = m_rcRegion.top + GetDlgItemInt(IDC_EDH_TB, NULL, TRUE); - } - else { - SetDlgItemInt(IDC_EDX_TB, m_rcRegion.left); - SetDlgItemInt(IDC_EDY_TB, m_rcRegion.top); - SetDlgItemInt(IDC_EDW_TB, m_rcRegion.Width()); - SetDlgItemInt(IDC_EDH_TB, m_rcRegion.Height()); - } -} \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/DskcapsetDlg.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/DskcapsetDlg.h deleted file mode 100644 index eb5d525f..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/DskcapsetDlg.h +++ /dev/null @@ -1,41 +0,0 @@ -#pragma once -#include "afxwin.h" - - -// CDskcapsetDlg Ի - -class CDskcapsetDlg : public CDialogEx -{ - DECLARE_DYNAMIC(CDskcapsetDlg) - -public: - CDskcapsetDlg(CWnd* pParent = NULL); // ׼캯 - virtual ~CDskcapsetDlg(); - -// Ի - enum { IDD = IDD_DSKCAPTB_DIALOG }; - - int GetCaptureFPS(); - void SetCaptureRect(LPCRECT lpRect); - void GetCaptureRect(LPRECT lpRect); - - int GetBitrate() { return m_nBitrate; }; - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ - virtual BOOL OnInitDialog(); - - afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); - - - DECLARE_MESSAGE_MAP() - -// data -private: - CRect m_rcRegion; - int m_nBitrate; - -// controls -private: - CComboBox m_cbxCaptureFPS; -}; diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/EnterChannelDlg.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/EnterChannelDlg.cpp deleted file mode 100644 index 77381973..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/EnterChannelDlg.cpp +++ /dev/null @@ -1,229 +0,0 @@ -// EnterChannelDlg.cpp : ʵļ -// - -#include "stdafx.h" -#include "OpenVideoCall.h" -#include "EnterChannelDlg.h" - - -#include "afxdialogex.h" - - -// CEnterChannelDlg Ի - -IMPLEMENT_DYNAMIC(CEnterChannelDlg, CDialogEx) - -CEnterChannelDlg::CEnterChannelDlg(CWnd* pParent /*=NULL*/) - : CDialogEx(CEnterChannelDlg::IDD, pParent) -{ - -} - -CEnterChannelDlg::~CEnterChannelDlg() -{ -} - -void CEnterChannelDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialogEx::DoDataExchange(pDX); - DDX_Control(pDX, IDC_EDCHNAME_CHANNEL, m_ctrChannel); - DDX_Control(pDX, IDC_EDENCKEY_CHANNEL, m_ctrEncKey); - DDX_Control(pDX, IDC_BTNTEST_CHANNEL, m_btnTest); - DDX_Control(pDX, IDC_BTNJOIN_CHANNEL, m_btnJoin); - DDX_Control(pDX, IDC_BTNSET_CHANNEL, m_btnSetup); -} - - -BEGIN_MESSAGE_MAP(CEnterChannelDlg, CDialogEx) - ON_WM_NCHITTEST() - ON_WM_PAINT() - ON_BN_CLICKED(IDC_BTNTEST_CHANNEL, &CEnterChannelDlg::OnBnClickedBtntestChannel) - ON_BN_CLICKED(IDC_BTNJOIN_CHANNEL, &CEnterChannelDlg::OnBnClickedBtnjoinChannel) - ON_BN_CLICKED(IDC_BTNSET_CHANNEL, &CEnterChannelDlg::OnBnClickedBtnsetChannel) -END_MESSAGE_MAP() - - -// CEnterChannelDlg Ϣ -BOOL CEnterChannelDlg::PreTranslateMessage(MSG* pMsg) -{ - if (pMsg->message == WM_KEYDOWN){ - switch (pMsg->wParam){ - case VK_ESCAPE: - return FALSE; - case VK_RETURN: - OnBnClickedBtnjoinChannel(); - return FALSE; - } - } - - return CDialogEx::PreTranslateMessage(pMsg); -} - -BOOL CEnterChannelDlg::OnInitDialog() -{ - CDialogEx::OnInitDialog(); - - // TODO: ڴӶijʼ - m_ftEncy.CreateFont(17, 0, 0, 0, FW_BOLD, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, _T("Arial")); - m_ftHead.CreateFont(15, 0, 0, 0, FW_NORMAL, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, _T("Arial")); - m_ftDesc.CreateFont(15, 0, 0, 0, FW_NORMAL, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, _T("Arial")); - m_ftBtn.CreateFont(16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, _T("Arial")); - m_penFrame.CreatePen(PS_SOLID, 1, RGB(0xD8, 0xD8, 0xD8)); - - m_dlgDevice.Create(CDeviceDlg::IDD, this); - m_dlgDevice.EnableDeviceTest(TRUE); - - SetBackgroundColor(RGB(0xFF, 0xFF, 0xFF)); - InitCtrls(); - - return TRUE; // return TRUE unless you set the focus to a control - // 쳣: OCX ҳӦ FALSE -} - -void CEnterChannelDlg::InitCtrls() -{ - CRect ClientRect; - -// MoveWindow(0, 0, 320, 450, 1); - GetClientRect(&ClientRect); - - m_ctrChannel.MoveWindow(ClientRect.Width()/2-160, 128, 320, 22, TRUE); - m_ctrChannel.SetFont(&m_ftHead); - m_ctrChannel.SetCaretPos(CPoint(12, 148)); - m_ctrChannel.ShowCaret(); - m_ctrChannel.SetTip(LANG_STR("IDS_CHN_CHTIP")); - - m_ctrEncKey.MoveWindow(ClientRect.Width() / 2 - 160, 176, 160, 22, TRUE); - m_ctrEncKey.SetFont(&m_ftHead); - m_ctrEncKey.SetCaretPos(CPoint(12, 148)); - m_ctrEncKey.ShowCaret(); - m_ctrEncKey.SetTip(LANG_STR("IDS_CHN_KEYTIP")); - - m_cmbEncType.Create(WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | CBS_OWNERDRAWVARIABLE, CRect(ClientRect.Width() / 2 + 1, 168, 180, 32), this, IDC_CMBENCTYPE_CHANNEL); - m_cmbEncType.MoveWindow(ClientRect.Width() / 2 + 50, 173, 120, 22, TRUE); - m_cmbEncType.SetFont(&m_ftHead); - - m_cmbEncType.SetButtonImage(IDB_CMBBTN, 12, 12, RGB(0xFF, 0x00, 0xFF)); - m_cmbEncType.SetFaceColor(RGB(0xFF, 0xFF, 0xFF), RGB(0xFF, 0xFF, 0xFF)); - m_cmbEncType.InsertString(0, LANG_STR("IDS_CHN_AES128XTS")); - m_cmbEncType.InsertString(1, LANG_STR("IDS_CHN_AES256XTS")); - m_cmbEncType.SetCurSel(0); - - m_btnJoin.MoveWindow(ClientRect.Width() / 2 - 180, 212, 360, 36, TRUE); - m_btnTest.MoveWindow(ClientRect.Width() / 2 - 180, 314, 108, 36, TRUE); - m_btnSetup.MoveWindow(ClientRect.Width()/2-60, 314, 240, 36, TRUE); - - - m_btnJoin.SetBackColor(RGB(0x00, 0xA0, 0xE9), RGB(0x05, 0x78, 0xAA), RGB(0x05, 0x78, 0xAA), RGB(0xE6, 0xE6, 0xE6)); - m_btnJoin.SetFont(&m_ftBtn); - m_btnJoin.SetTextColor(RGB(0xFF, 0xFF, 0xFF), RGB(0xFF, 0xFF, 0xFF), RGB(0xFF, 0xFF, 0xFF), RGB(0xCC, 0xCC, 0xCC)); - m_btnJoin.SetWindowText(LANG_STR("IDS_CHN_BTJOIN")); - - m_btnTest.SetBorderColor(RGB(0xD8, 0xD8, 0xD8), RGB(0x00, 0xA0, 0xE9), RGB(0x00, 0xA0, 0xE9), RGB(0xCC, 0xCC, 0xCC)); - m_btnTest.SetBackColor(RGB(0xFF, 0xFF, 0xFF), RGB(0xFF, 0xFF, 0xFF), RGB(0xFF, 0xFF, 0xFF), RGB(0xFF, 0xFF, 0xFF)); - m_btnTest.SetFont(&m_ftBtn); - m_btnTest.SetTextColor(RGB(0x55, 0x58, 0x5A), RGB(0x00, 0xA0, 0xE9), RGB(0x00, 0xA0, 0xE9), RGB(0xCC, 0xCC, 0xCC)); - m_btnTest.SetWindowText(LANG_STR("IDS_CHN_BTTEST")); - - m_btnSetup.SetBorderColor(RGB(0xD8, 0xD8, 0xD8), RGB(0x00, 0xA0, 0xE9), RGB(0x00, 0xA0, 0xE9), RGB(0xCC, 0xCC, 0xCC)); - m_btnSetup.SetBackColor(RGB(0xFF, 0xFF, 0xFF), RGB(0xFF, 0xFF, 0xFF), RGB(0xFF, 0xFF, 0xFF), RGB(0xFF, 0xFF, 0xFF)); - m_btnSetup.SetFont(&m_ftBtn); - m_btnSetup.SetTextColor(RGB(0x55, 0x58, 0x5A), RGB(0x00, 0xA0, 0xE9), RGB(0x00, 0xA0, 0xE9), RGB(0xCC, 0xCC, 0xCC)); - m_btnSetup.SetWindowText(_T("1920*1080,15fps, 3mbps")); - - CMFCButton::EnableWindowsTheming(FALSE); -} - -void CEnterChannelDlg::OnPaint() -{ - CPaintDC dc(this); // device context for painting - - DrawClient(&dc); -} - - -void CEnterChannelDlg::DrawClient(CDC *lpDC) -{ - CRect rcText; - CRect rcClient; - LPCTSTR lpString = NULL; - - GetClientRect(&rcClient); - - CFont* defFont = lpDC->SelectObject(&m_ftHead); - lpDC->SetBkColor(RGB(0xFF, 0xFF, 0xFF)); - lpDC->SetTextColor(RGB(0x44, 0x45, 0x46)); - lpString = LANG_STR("IDS_CHN_TITLE"); - lpDC->TextOut(12, 10, lpString, _tcslen(lpString)); - - lpDC->SelectObject(&m_penFrame); - rcText.SetRect(rcClient.Width() / 2 - 188, 120, rcClient.Width() / 2 + 172, 152); - lpDC->RoundRect(&rcText, CPoint(32, 32)); - - rcText.OffsetRect(0, 48); - lpDC->RoundRect(&rcText, CPoint(32, 32)); - - lpDC->SelectObject(&m_ftDesc); - lpDC->SetTextColor(RGB(0x91, 0x96, 0xA0)); - lpString = LANG_STR("IDS_CHN_DSC1"); - lpDC->TextOut(12, 45, lpString, _tcslen(lpString)); - lpString = LANG_STR("IDS_CHN_DSC2"); - lpDC->TextOut(12, 65, lpString, _tcslen(lpString)); - - lpDC->SetTextColor(RGB(0xD8, 0xD8, 0xD8)); - lpString = LANG_STR("IDS_CHN_ENCTYPE"); - lpDC->TextOut(240, 176, lpString, _tcslen(lpString)); - - lpDC->SelectObject(defFont); - - // Done with the font. Delete the font object. - // font.DeleteObject(); -} - -void CEnterChannelDlg::OnBnClickedBtntestChannel() -{ - // TODO: ڴӿؼ֪ͨ - m_dlgDevice.ShowWindow(SW_SHOW); - m_dlgDevice.CenterWindow(); -} - - -void CEnterChannelDlg::OnBnClickedBtnjoinChannel() -{ - // TODO: ڴӿؼ֪ͨ -// CString str = CAgoraObject::GetAgoraObject()->GetCallID(); - CString strKey; - - m_ctrEncKey.GetWindowText(strKey); - if (strKey.GetLength() > 0) - CAgoraObject::GetAgoraObject()->SetEncryptionSecret(strKey, m_cmbEncType.GetCurSel()); - GetParent()->SendMessage(WM_JOINCHANNEL, 0, 0); -} - - -void CEnterChannelDlg::OnBnClickedBtnsetChannel() -{ - // TODO: ڴӿؼ֪ͨ -// SHORT sKeyStat = ::GetAsyncKeyState(VK_CONTROL); - - GetParent()->SendMessage(WM_GONEXT, 0, 0); -} - -CString CEnterChannelDlg::GetChannelName() -{ - CString strChannelName; - - m_ctrChannel.GetWindowText(strChannelName); - - return strChannelName; -} - -void CEnterChannelDlg::SetVideoString(LPCTSTR lpVideoString) -{ - m_btnSetup.SetWindowText(lpVideoString); -} - -void CEnterChannelDlg::CleanEncryptionSecret() -{ - m_ctrEncKey.SetWindowText(_T("")); -} \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/EnterChannelDlg.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/EnterChannelDlg.h deleted file mode 100644 index b0a221d8..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/EnterChannelDlg.h +++ /dev/null @@ -1,58 +0,0 @@ -#pragma once -#include "AGButton.h" -#include "AGEdit.h" -#include "AGComboBox.h" -#include "DeviceDlg.h" -#include "afxwin.h" - -// CEnterChannelDlg Ի - -class CEnterChannelDlg : public CDialogEx -{ - DECLARE_DYNAMIC(CEnterChannelDlg) - -public: - CEnterChannelDlg(CWnd* pParent = NULL); // ׼캯 - virtual ~CEnterChannelDlg(); - - CString GetChannelName(); - - void SetVideoString(LPCTSTR lpVideoString); - void CleanEncryptionSecret(); - -// Ի - enum { IDD = IDD_ENTERCHANNEL_DIALOG }; - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ - virtual BOOL OnInitDialog(); - virtual BOOL PreTranslateMessage(MSG* pMsg); - - afx_msg void OnPaint(); - afx_msg void OnBnClickedBtntestChannel(); - afx_msg void OnBnClickedBtnjoinChannel(); - afx_msg void OnBnClickedBtnsetChannel(); - - DECLARE_MESSAGE_MAP() - -protected: - void InitCtrls(); - void DrawClient(CDC *lpDC); - -private: - CAGEdit m_ctrChannel; - CAGEdit m_ctrEncKey; - CAGComboBox m_cmbEncType; - CAGButton m_btnTest; - CAGButton m_btnJoin; - CAGButton m_btnSetup; - - CFont m_ftEncy; - CFont m_ftHead; - CFont m_ftDesc; - CFont m_ftBtn; - - CPen m_penFrame; - - CDeviceDlg m_dlgDevice; -}; diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/LanguageSet.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/LanguageSet.cpp deleted file mode 100644 index e14b6294..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/LanguageSet.cpp +++ /dev/null @@ -1,108 +0,0 @@ -#include "stdafx.h" -#include "LanguageSet.h" - -CLanguageSet *CLanguageSet::m_lpLanguageSet = NULL; -TCHAR CLanguageSet::m_szSelfPath[MAX_PATH]; - -CLanguageSet::CLanguageSet() -{ -} - - -CLanguageSet::~CLanguageSet() -{ -} - -CLanguageSet *CLanguageSet::GetInstance() -{ - if (CLanguageSet::m_lpLanguageSet == NULL) - CLanguageSet::m_lpLanguageSet = new CLanguageSet(); - - ::GetModuleFileName(NULL, CLanguageSet::m_szSelfPath, MAX_PATH); - LPTSTR lpLastSlash = _tcsrchr(CLanguageSet::m_szSelfPath, _T('\\')) + 1; - _tcscpy_s(lpLastSlash, MAX_PATH, _T("Language\\")); - - CString strLanguageName = CLanguageSet::m_lpLanguageSet->GetCurrentLanguage(); - - CLanguageSet::m_lpLanguageSet->LoadLanguageModule(strLanguageName); - - return CLanguageSet::m_lpLanguageSet; -} - -void CLanguageSet::CloseInstance() -{ - CLanguageSet::m_lpLanguageSet->UnloadLanguageModule(); - delete CLanguageSet::m_lpLanguageSet; - - CLanguageSet::m_lpLanguageSet = NULL; -} - -CString CLanguageSet::GetCurrentLanguage() -{ - CString strCurrent; - TCHAR szProfilePath[MAX_PATH]; - - _tcscpy_s(szProfilePath, MAX_PATH, CLanguageSet::m_szSelfPath); - _tcscat_s(szProfilePath, MAX_PATH, _T("Language.ini")); - - ::GetPrivateProfileString(_T("language"), _T("current"), _T("english.dll"), strCurrent.GetBuffer(MAX_PATH), MAX_PATH, szProfilePath); - - strCurrent.ReleaseBuffer(); - - return strCurrent; -} - -BOOL CLanguageSet::SetCurrentLanguage(LPCTSTR lpLanguageName) -{ - TCHAR szProfilePath[MAX_PATH]; - TCHAR szModulePath[MAX_PATH]; - - _tcscpy_s(szProfilePath, MAX_PATH, CLanguageSet::m_szSelfPath); - _tcscat_s(szProfilePath, _T("Language.ini")); - - _tcscpy_s(szModulePath, MAX_PATH, CLanguageSet::m_szSelfPath); - _tcscat_s(szModulePath, MAX_PATH, lpLanguageName); - _tcscat_s(szModulePath, MAX_PATH, _T(".dll")); - if (::GetFileAttributes(szModulePath) == INVALID_FILE_ATTRIBUTES) - return FALSE; - - return ::WritePrivateProfileString(_T("language"), _T("current"), lpLanguageName, szProfilePath); -} - -LPCTSTR CLanguageSet::GetString(LPCSTR lpStringID) -{ - ASSERT(m_hLanguageModule != NULL); - - LPCTSTR *lpStrAddr = (LPCTSTR *)::GetProcAddress(m_hLanguageModule, lpStringID); - - return *lpStrAddr;// ::GetProcAddress(m_hLanguageModule, lpStringID); -} - -BOOL CLanguageSet::LoadLanguageModule(LPCTSTR lpLanguageName) -{ - TCHAR szModulePath[MAX_PATH]; - LPTSTR lpLastSlash = NULL; - - _tcscpy_s(szModulePath, MAX_PATH, CLanguageSet::m_szSelfPath); - - if (lpLanguageName == NULL) - _tcscat_s(szModulePath, MAX_PATH, GetCurrentLanguage()); - else - _tcscat_s(szModulePath, MAX_PATH, lpLanguageName); - -// _tcscat_s(szModulePath, MAX_PATH, _T(".dll")); - if (::GetFileAttributes(szModulePath) == INVALID_FILE_ATTRIBUTES) - return FALSE; - - m_hLanguageModule = ::LoadLibrary(szModulePath); - - return m_hLanguageModule != NULL ? TRUE : FALSE; -} - -void CLanguageSet::UnloadLanguageModule() -{ - if (m_hLanguageModule != NULL) - ::FreeLibrary(m_hLanguageModule); - - m_hLanguageModule = NULL; -} \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/LanguageSet.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/LanguageSet.h deleted file mode 100644 index 41509993..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/LanguageSet.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -//#define LANGUAGE_SET_MSG _T("SNOWWALKER_LANGSET_MSG") - -#define LANG_STR(lpStringID) (CLanguageSet::GetInstance()->GetString(lpStringID)) - -class CLanguageSet -{ -protected: - CLanguageSet(); - ~CLanguageSet(); - -public: - static CLanguageSet *GetInstance(); - static void CloseInstance(); - - CString GetCurrentLanguage(); - BOOL SetCurrentLanguage(LPCTSTR lpLanguageName); - LPCTSTR GetString(LPCSTR lpStringID); - - BOOL LoadLanguageModule(LPCTSTR lpLanguageName = NULL); - void UnloadLanguageModule(); - -private: - HMODULE m_hLanguageModule; - static CLanguageSet *m_lpLanguageSet; - static TCHAR m_szSelfPath[MAX_PATH]; -}; - diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/LogoDlg.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/LogoDlg.cpp deleted file mode 100644 index d66f0c54..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/LogoDlg.cpp +++ /dev/null @@ -1,168 +0,0 @@ -// LogoDlg.cpp : ʵļ -// - -#include "stdafx.h" -#include "OpenVideoCall.h" -#include "LogoDlg.h" -#include "afxdialogex.h" - - -// CLogoDlg Ի - -IMPLEMENT_DYNAMIC(CLogoDlg, CDialogEx) - -CLogoDlg::CLogoDlg(CWnd* pParent /*=NULL*/) - : CDialogEx(CLogoDlg::IDD, pParent) -{ - m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); - m_bmpLogo.LoadBitmap(IDB_LOGO); -} - -CLogoDlg::~CLogoDlg() -{ -} - -void CLogoDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialogEx::DoDataExchange(pDX); - DDX_Control(pDX, IDC_BTNMIN, m_btnMin); - DDX_Control(pDX, IDC_BTNCLOSE, m_btnClose); -} - - -BEGIN_MESSAGE_MAP(CLogoDlg, CDialogEx) - ON_WM_NCHITTEST() - ON_BN_CLICKED(IDC_BTNMIN, &CLogoDlg::OnBnClickedBtnmin) - ON_BN_CLICKED(IDC_BTNCLOSE, &CLogoDlg::OnBnClickedBtnclose) - ON_WM_TIMER() - ON_WM_PAINT() -END_MESSAGE_MAP() - - -// CLogoDlg Ϣ - -BOOL CLogoDlg::OnInitDialog() -{ - CDialogEx::OnInitDialog(); - - // Add "About..." menu item to system menu. - - // Set the icon for this dialog. The framework does this automatically - // when the application's main window is not a dialog - SetIcon(m_hIcon, TRUE); // Set big icon - SetIcon(m_hIcon, FALSE); // Set small icon - - // TODO: Add extra initialization here - m_ftTitle.CreateFont(16, 0, 0, 0, FW_BOLD, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, _T("Arial")); - m_ftDescp.CreateFont(15, 0, 0, 0, FW_BOLD, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, _T("Arial")); - - SetBackgroundColor(RGB(0xFF, 0xFF, 0xFF)); - InitCtrls(); - - AnimateWindow(500, AW_BLEND | AW_SLIDE); - m_nTimerID = SetTimer(1, 1000, NULL); - - Invalidate(TRUE); - - return TRUE; // return TRUE unless you set the focus to a control -} - -void CLogoDlg::InitCtrls() -{ - CRect ClientRect; - - MoveWindow(0, 0, 720, 600, 1); - GetClientRect(&ClientRect); - CenterWindow(); - - m_btnMin.MoveWindow(ClientRect.Width() - 46, 1, 22, 22, TRUE); - m_btnClose.MoveWindow(ClientRect.Width() - 23, 1, 22, 22, TRUE); - - m_btnMin.SetBackImage(IDB_BTNMIN, RGB(0xFF, 0, 0xFF)); - m_btnClose.SetBackImage(IDB_BTNCLOSE, RGB(0xFF, 0, 0xFF)); - - CMFCButton::EnableWindowsTheming(FALSE); -} - - -LRESULT CLogoDlg::OnNcHitTest(CPoint point) -{ - // TODO: ڴϢ/Ĭֵ - LRESULT lResult = CDialogEx::OnNcHitTest(point); - if (lResult == HTCLIENT && ::GetAsyncKeyState(MK_LBUTTON) < 0) - lResult = HTCAPTION; - - return lResult; -} - -void CLogoDlg::DrawClient(CDC *lpDC) -{ - CRect rcText; - CDC memDC; - - LPCTSTR lpString = NULL; - CFont* defFont = lpDC->SelectObject(&m_ftTitle); - - memDC.CreateCompatibleDC(lpDC); - memDC.SelectObject(&m_bmpLogo); - lpString = LANG_STR("IDS_TITLE"); - lpDC->FillSolidRect(0, 0, 720, 24, RGB(0, 161, 230)); - lpDC->SetBkColor(RGB(0x00, 0x9E, 0xEB)); - lpDC->SetTextColor(RGB(0xFF, 0xFF, 0xFF)); - rcText.SetRect(5, 5, 20, 400); - lpDC->TextOut(320, 3, lpString, _tcslen(lpString)); - - lpDC->SetBkColor(RGB(0xFF, 0xFF, 0xFF)); - lpDC->SetTextColor(RGB(0x91, 0x96, 0xA0)); - lpDC->TextOut(305, 316, lpString, _tcslen(lpString)); - - lpString = LANG_STR("IDS_LOGO_DESC"); - lpDC->SelectObject(&m_ftDescp); - lpDC->SetTextColor(RGB(0x00, 0x9D, 0xEB)); - lpDC->TextOut(255, 348, lpString, _tcslen(lpString)); - - lpDC->BitBlt(294, 224, 132, 72, &memDC, 0, 0, SRCCOPY); - - lpDC->SelectObject(defFont); -} - -void CLogoDlg::OnBnClickedBtnmin() -{ - // TODO: ڴӿؼ֪ͨ - ShowWindow(SW_MINIMIZE); -} - - -void CLogoDlg::OnBnClickedBtnclose() -{ - // TODO: ڴӿؼ֪ͨ -#ifdef DEBUG - AnimateWindow(3000, AW_BLEND | AW_HIDE | AW_SLIDE); -#else - AnimateWindow(1000, AW_BLEND | AW_HIDE | AW_SLIDE); -#endif - CDialogEx::OnCancel(); -} - - - -void CLogoDlg::OnTimer(UINT_PTR nIDEvent) -{ - // TODO: ڴϢ/Ĭֵ - if (nIDEvent == 1){ - PostMessage(WM_COMMAND, (WPARAM)IDCANCEL, NULL); - KillTimer(1); - } - - CDialogEx::OnTimer(nIDEvent); -} - - -void CLogoDlg::OnPaint() -{ - CPaintDC dc(this); // device context for painting - // TODO: ڴ˴Ϣ - // ΪͼϢ CDialogEx::OnPaint() - - DrawClient(&dc); -} diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/LogoDlg.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/LogoDlg.h deleted file mode 100644 index 66d3f076..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/LogoDlg.h +++ /dev/null @@ -1,48 +0,0 @@ -#pragma once -#include "AGButton.h" - -// CLogoDlg Ի - -class CLogoDlg : public CDialogEx -{ - DECLARE_DYNAMIC(CLogoDlg) - -public: - CLogoDlg(CWnd* pParent = NULL); // ׼캯 - virtual ~CLogoDlg(); - -// Ի - enum { IDD = IDD_LOGO_DIALOG }; - -protected: - HICON m_hIcon; - - // Generated message map functions - virtual BOOL OnInitDialog(); - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ - afx_msg HCURSOR OnQueryDragIcon(); - afx_msg LRESULT OnNcHitTest(CPoint point); - - afx_msg void OnBnClickedBtnmin(); - afx_msg void OnBnClickedBtnclose(); - afx_msg void OnTimer(UINT_PTR nIDEvent); - afx_msg void OnPaint(); - - DECLARE_MESSAGE_MAP() - -protected: - void InitCtrls(); - void DrawClient(CDC *lpDC); - -private: - CAGButton m_btnMin; - CAGButton m_btnClose; - - CFont m_ftTitle; - CFont m_ftDescp; - - UINT_PTR m_nTimerID; - -private: - CBitmap m_bmpLogo; -}; diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCall.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCall.cpp deleted file mode 100644 index 96ddb2f0..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCall.cpp +++ /dev/null @@ -1,112 +0,0 @@ - -// AgoraVideoCall.cpp : Defines the class behaviors for the application. -// - -#include "stdafx.h" -#include "OpenVideoCall.h" -#include "LogoDlg.h" -#include "OpenVideoCallDlg.h" -#include "EnterChannelDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#endif - - -// CAgoraVideoCallApp - -BEGIN_MESSAGE_MAP(COpenVideoCallApp, CWinApp) - ON_COMMAND(ID_HELP, &CWinApp::OnHelp) -END_MESSAGE_MAP() - - -// CAgoraVideoCallApp construction - -COpenVideoCallApp::COpenVideoCallApp() -{ - // support Restart Manager - m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART; - - // TODO: add construction code here, - // Place all significant initialization in InitInstance -} - - -// The one and only CAgoraVideoCallApp object - -COpenVideoCallApp theApp; - - -// CAgoraVideoCallApp initialization - -BOOL COpenVideoCallApp::InitInstance() -{ - // InitCommonControlsEx() is required on Windows XP if an application - // manifest specifies use of ComCtl32.dll version 6 or later to enable - // visual styles. Otherwise, any window creation will fail. - INITCOMMONCONTROLSEX InitCtrls; - InitCtrls.dwSize = sizeof(InitCtrls); - // Set this to include all the common control classes you want to use - // in your application. - InitCtrls.dwICC = ICC_WIN95_CLASSES; - InitCommonControlsEx(&InitCtrls); - - CWinApp::InitInstance(); - - - AfxEnableControlContainer(); - - // Create the shell manager, in case the dialog contains - // any shell tree view or shell list view controls. - CShellManager *pShellManager = new CShellManager; - - // Activate "Windows Native" visual manager for enabling themes in MFC controls - CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows)); - - // Standard initialization - // If you are not using these features and wish to reduce the size - // of your final executable, you should remove from the following - // the specific initialization routines you do not need - // Change the registry key under which our settings are stored - // TODO: You should modify this string to be something appropriate - // such as the name of your company or organization - SetRegistryKey(_T("Local AppWizard-Generated Applications")); - CAgoraObject::EnableWhiteboardVer(TRUE); - CAgoraObject::EnableWhiteboardFeq(TRUE); - - INT_PTR nResponse = 0; - CLogoDlg Logo; - - nResponse = Logo.DoModal(); - COpenVideoCallDlg avcDlg; - - m_pMainWnd = &avcDlg; - nResponse = avcDlg.DoModal(); - - if (nResponse == IDOK) - { - // TODO: Place code here to handle when the dialog is - // dismissed with OK - } - else if (nResponse == IDCANCEL) - { - // TODO: Place code here to handle when the dialog is - // dismissed with Cancel - } - else if (nResponse == -1) - { - TRACE(traceAppMsg, 0, "Warning: dialog creation failed, so application is terminating unexpectedly.\n"); - TRACE(traceAppMsg, 0, "Warning: if you are using MFC controls on the dialog, you cannot #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS.\n"); - } - - // Delete the shell manager created above. - if (pShellManager != NULL) - { - delete pShellManager; - } - - // Since the dialog has been closed, return FALSE so that we exit the - // application, rather than start the application's message pump. - return FALSE; -} - diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCall.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCall.h deleted file mode 100644 index 60f8018e..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCall.h +++ /dev/null @@ -1,32 +0,0 @@ - -// OpenVideoCall.h : main header file for the PROJECT_NAME application -// - -#pragma once - -#ifndef __AFXWIN_H__ - #error "include 'stdafx.h' before including this file for PCH" -#endif - -#include "resource.h" // main symbols - - -// CAgoraVideoCallApp: -// See AgoraVideoCall.cpp for the implementation of this class -// - -class COpenVideoCallApp : public CWinApp -{ -public: - COpenVideoCallApp(); - -// Overrides -public: - virtual BOOL InitInstance(); - -// Implementation - - DECLARE_MESSAGE_MAP() -}; - -extern COpenVideoCallApp theApp; \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCall.rc b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCall.rc deleted file mode 100644 index 50da9f92..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCall.rc and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCall.vcxproj b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCall.vcxproj deleted file mode 100644 index 3411d709..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCall.vcxproj +++ /dev/null @@ -1,375 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {26AF88DC-1933-4A1B-9991-21DF11DCE388} - AgoraVideoCall - MFCProj - - - - Application - true - v120_xp - Unicode - Static - - - Application - true - v120 - Unicode - Static - - - Application - false - v120_xp - true - Unicode - Static - - - Application - false - v120_xp - true - Unicode - Static - - - - - - - - - - - - - - - - - - - true - $(VC_IncludePath);$(WindowsSDK_IncludePath);../../../sdk/include;../sdk/include;../../sdk/include - $(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);../../../sdk/lib;../sdk/lib;../../sdk/lib - - - true - $(VC_IncludePath);$(WindowsSDK_IncludePath);../../../sdk/include;../sdk/include;../../sdk/include - $(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);../../../sdk/lib;../sdk/lib;../../sdk/lib - $(SolutionDir)\$(Configuration)\ - $(Configuration)\ - - - false - $(VC_ExecutablePath_x86);$(WindowsSdk_71A_ExecutablePath);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH); - - $(VC_IncludePath);$(WindowsSdk_71A_IncludePath);$(MSBuild_ExecutablePath);$(VC_LibraryPath_x86); - $(VC_IncludePath);$(WindowsSdk_71A_IncludePath);../../../sdk/include;../sdk/include;../../sdk/include - $(VC_LibraryPath_x86);$(WindowsSdk_71A_LibraryPath_x86);../../../sdk/lib;../sdk/lib;../../sdk/lib - - - false - $(VC_IncludePath);$(WindowsSdk_71A_IncludePath);../../../sdk/include;../sdk/include;../../sdk/include - $(VC_LibraryPath_x64);$(WindowsSdk_71A_LibraryPath_x64);../../../sdk/lib;../sdk/lib;../../sdk/lib - $(SolutionDir)\$(Configuration)\ - $(Configuration)\ - - - - Use - Level3 - Disabled - WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - - - Windows - true - - - false - true - _DEBUG;%(PreprocessorDefinitions) - - - 0x0409 - _DEBUG;%(PreprocessorDefinitions) - $(IntDir);%(AdditionalIncludeDirectories) - - - if exist ..\sdk (copy ..\sdk\dll\*.dll ..\Debug\) else if exist ..\..\..\sdk (copy ..\..\..\sdk\dll\*.dll ..\Debug\) - - - - - Use - Level3 - Disabled - WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - - - Windows - true - - - false - _DEBUG;%(PreprocessorDefinitions) - - - 0x0409 - _DEBUG;%(PreprocessorDefinitions) - $(IntDir);%(AdditionalIncludeDirectories) - - - if exist ..\sdk (copy ..\sdk\dll\*.dll ..\Debug\) else if exist ..\..\..\sdk (copy ..\..\..\sdk\dll\*.dll ..\Debug\) - - - - - Level3 - Use - MaxSpeed - true - true - WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - - - Windows - true - true - true - - - false - true - NDEBUG;%(PreprocessorDefinitions) - - - 0x0409 - NDEBUG;%(PreprocessorDefinitions) - $(IntDir);%(AdditionalIncludeDirectories) - - - if exist ..\sdk (copy ..\sdk\dll\*.dll ..\Release\) else if exist ..\..\..\sdk (copy ..\..\..\sdk\dll\*.dll ..\Release\) - - - - - Level3 - Use - MaxSpeed - true - true - WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - - - Windows - true - true - true - - - false - NDEBUG;%(PreprocessorDefinitions) - - - 0x0409 - NDEBUG;%(PreprocessorDefinitions) - $(IntDir);%(AdditionalIncludeDirectories) - - - if exist ..\sdk (copy ..\sdk\dll\*.dll ..\Release\) else if exist ..\..\..\sdk (copy ..\..\..\sdk\dll\*.dll ..\Release\) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Create - Create - Create - Create - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {898289d0-0d57-4b8e-97ae-013114f85de9} - - - {de1d9363-5455-4448-8d69-d22be47f5a82} - - - - - - - - - - - diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCall.vcxproj.filters b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCall.vcxproj.filters deleted file mode 100644 index c334e18d..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCall.vcxproj.filters +++ /dev/null @@ -1,441 +0,0 @@ - - - - - {037bfcf0-7fcd-4fbe-b0a1-0bbdbe0866d4} - - - {dd6bd31f-57a0-4970-9870-4cbe6ead6530} - - - {22427098-c248-4e25-8c81-dd62508cf969} - - - {f8fa6769-043b-462c-8c2f-587906eee318} - - - {0f1c5e51-801f-4f53-a0af-3cec416b9702} - - - {2c600536-0ba8-4ae7-af61-78ffa247aed6} - - - {3d18d002-94ff-47be-ac37-9421b990e85a} - - - {075d76ad-44ba-49b2-8b94-0d123ad2bbb8} - - - {72981e3b-6e49-43b0-b4e1-fdeb7568d012} - - - {6c1a4b26-8ded-4c5d-a541-a9ed38a22ee8} - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - - - - Headers - - - Headers - - - Headers - - - UI\Language - - - UI\Ctrl - - - UI\Ctrl - - - UI\Ctrl - - - UI\Dialog - - - UI\Dialog - - - Headers - - - UI\Dialog - - - UI\Ctrl - - - UI\Ctrl - - - UI\Dialog - - - AgoraObject - - - UI\Dialog - - - AgoraObject - - - AgoraObject - - - AgoraObject - - - AgoraObject - - - AgoraObject - - - AgoraObject\Config - - - UI\Wnd - - - UI\Wnd - - - UI\Dialog - - - UI\Ctrl - - - UI\Dialog - - - AgoraObject\Filter - - - App - - - UI\Dialog - - - UI\Dialog - - - UI\Dialog - - - - - Headers - - - UI\Language - - - UI\Ctrl - - - UI\Ctrl - - - UI\Ctrl - - - UI\Dialog - - - UI\Dialog - - - UI\Dialog - - - UI\Ctrl - - - UI\Ctrl - - - UI\Dialog - - - AgoraObject - - - AgoraObject - - - UI\Dialog - - - AgoraObject - - - AgoraObject - - - AgoraObject - - - AgoraObject - - - AgoraObject\Config - - - UI\Wnd - - - UI\Wnd - - - UI\Dialog - - - UI\Ctrl - - - UI\Dialog - - - AgoraObject\Filter - - - App - - - UI\Dialog - - - UI\Dialog - - - UI\Dialog - - - - - Resources - - - - - Resources - - - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - Resources - - - - - Resources - - - \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCall.vcxproj.user b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCall.vcxproj.user deleted file mode 100644 index ef5ff2a1..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCall.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCallDlg.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCallDlg.cpp deleted file mode 100644 index 177dfd67..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCallDlg.cpp +++ /dev/null @@ -1,362 +0,0 @@ - -// AgoraVideoCallDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "OpenVideoCall.h" -#include "OpenVideoCallDlg.h" -#include "afxdialogex.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#endif - - -// CAgoraVideoCallDlg dialog - - - -COpenVideoCallDlg::COpenVideoCallDlg(CWnd* pParent /*=NULL*/) - : CDialogEx(COpenVideoCallDlg::IDD, pParent) -{ - m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); - m_nVideoSolution = 0; - - m_lpAgoraObject = NULL; - m_lpRtcEngine = NULL; - - m_nLastmileQuality = 0; -} - -void COpenVideoCallDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialogEx::DoDataExchange(pDX); - DDX_Control(pDX, IDC_BTNMIN, m_btnMin); - DDX_Control(pDX, IDC_BTNCLOSE, m_btnClose); - - DDX_Control(pDX, IDC_LINKAGORA, m_linkAgora); -} - -BEGIN_MESSAGE_MAP(COpenVideoCallDlg, CDialogEx) - ON_WM_SYSCOMMAND() - ON_WM_PAINT() - ON_WM_QUERYDRAGICON() - ON_WM_NCHITTEST() - ON_MESSAGE(WM_GOBACK, &COpenVideoCallDlg::OnBackPage) - ON_MESSAGE(WM_GONEXT, &COpenVideoCallDlg::OnNextPage) - ON_MESSAGE(WM_JOINCHANNEL, &COpenVideoCallDlg::OnJoinChannel) - ON_MESSAGE(WM_LEAVECHANNEL, &COpenVideoCallDlg::OnLeaveChannel) - - ON_BN_CLICKED(IDC_BTNMIN, &COpenVideoCallDlg::OnBnClickedBtnmin) - ON_BN_CLICKED(IDC_BTNCLOSE, &COpenVideoCallDlg::OnBnClickedBtnclose) - - ON_MESSAGE(WM_MSGID(EID_LASTMILE_QUALITY), &COpenVideoCallDlg::OnLastmileQuality) - -END_MESSAGE_MAP() - - -// CAgoraVideoCallDlg message handlers -BOOL COpenVideoCallDlg::PreTranslateMessage(MSG* pMsg) -{ - if (pMsg->message == WM_KEYDOWN){ - switch (pMsg->wParam){ - case VK_ESCAPE: - case VK_RETURN: - return FALSE; - } - } - - return CDialogEx::PreTranslateMessage(pMsg); -} - -BOOL COpenVideoCallDlg::OnInitDialog() -{ - CDialogEx::OnInitDialog(); - - // Add "About..." menu item to system menu. - - // IDM_ABOUTBOX must be in the system command range. - ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); - ASSERT(IDM_ABOUTBOX < 0xF000); - - CMenu* pSysMenu = GetSystemMenu(FALSE); - if (pSysMenu != NULL) - { - BOOL bNameValid; - CString strAboutMenu; - bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX); - ASSERT(bNameValid); - if (!strAboutMenu.IsEmpty()) - { - pSysMenu->AppendMenu(MF_SEPARATOR); - pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); - } - } - - // Set the icon for this dialog. The framework does this automatically - // when the application's main window is not a dialog - SetIcon(m_hIcon, TRUE); // Set big icon - SetIcon(m_hIcon, FALSE); // Set small icon - - // TODO: Add extra initialization here - m_ftTitle.CreateFont(16, 0, 0, 0, FW_BOLD, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, _T("Arial")); - m_ftLink.CreateFont(16, 0, 0, 0, FW_NORMAL, FALSE, TRUE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, _T("Arial")); - m_ftDes.CreateFont(15, 0, 0, 0, FW_NORMAL, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, _T("Arial")); - m_ftPhone.CreateFont(15, 0, 0, 0, FW_BOLD, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, _T("Arial")); - - CString strAppID = CAgoraObject::LoadAppID(); - - if (_tcslen(strAppID) == 0) { - MessageBox(_T("Please define your own APP_ID in source code"), _T("information"), MB_OK | MB_ICONINFORMATION); - ::PostQuitMessage(0); - } - - m_lpAgoraObject = CAgoraObject::GetAgoraObject(strAppID); - m_lpRtcEngine = CAgoraObject::GetEngine(); - m_lpAgoraObject->EnableVideo(TRUE); - m_lpAgoraObject->SetLogFilePath(NULL); - m_lpAgoraObject->EnableNetworkTest(TRUE); - m_lpAgoraObject->SetMsgHandlerWnd(GetSafeHwnd()); - - SetBackgroundColor(RGB(0xFF, 0xFF, 0xFF)); - InitCtrls(); - InitChildDialog(); - - return TRUE; // return TRUE unless you set the focus to a control -} - -void COpenVideoCallDlg::InitCtrls() -{ - CRect ClientRect; - CBitmap bmpNetQuality; - - MoveWindow(0, 0, 720, 600, 1); - GetClientRect(&ClientRect); - - bmpNetQuality.LoadBitmap(IDB_NETWORK_QUALITY); - - m_imgNetQuality.Create(32, 32, ILC_COLOR24 | ILC_MASK, 6, 1); - m_imgNetQuality.Add(&bmpNetQuality, RGB(0xFF, 0, 0xFF)); - - m_btnMin.MoveWindow(ClientRect.Width() - 46, 1, 22, 22, TRUE); - m_btnClose.MoveWindow(ClientRect.Width() - 23, 1, 22, 22, TRUE); - m_linkAgora.MoveWindow(ClientRect.Width() / 2 - 110, ClientRect.Height()-55, 80, 20, TRUE); - - m_btnMin.SetBackImage(IDB_BTNMIN, RGB(0xFF, 0, 0xFF)); - m_btnClose.SetBackImage(IDB_BTNCLOSE, RGB(0xFF, 0, 0xFF)); - - m_linkAgora.SetFont(&m_ftLink); - m_linkAgora.SetURL(_T("http://www.agora.io")); - m_linkAgora.SetWindowText(LANG_STR("IDS_LOGO_AGORAWEB")); - CMFCButton::EnableWindowsTheming(FALSE); -} - -void COpenVideoCallDlg::InitChildDialog() -{ - CString str; - - m_dlgEnterChannel.Create(CEnterChannelDlg::IDD, this); - m_dlgSetup.Create(CSetupDlg::IDD, this); - m_dlgVideo.Create(CVideoDlg::IDD, this); - - m_dlgEnterChannel.MoveWindow(110, 70, 500, 450, TRUE); - m_dlgSetup.MoveWindow(110, 70, 500, 450, TRUE); - - m_dlgEnterChannel.ShowWindow(SW_SHOW); - m_lpCurDialog = &m_dlgEnterChannel; - - m_dlgEnterChannel.SetVideoString(m_dlgSetup.GetVideoSolutionDes()); - -// str.Format(_T("%d*%d,%dfps,%dKbps"), m_nVideoWidth, m_nVideoHeight, m_nFrameRate, m_nMaxRate); -// m_dlgEnterChannel.SetVideoString(str); -} - -void COpenVideoCallDlg::OnSysCommand(UINT nID, LPARAM lParam) -{ - CDialogEx::OnSysCommand(nID, lParam); -} - -// If you add a minimize button to your dialog, you will need the code below -// to draw the icon. For MFC applications using the document/view model, -// this is automatically done for you by the framework. - -void COpenVideoCallDlg::OnPaint() -{ - CPaintDC dc(this); // device context for painting - - if (IsIconic()) - { - SendMessage(WM_ICONERASEBKGND, reinterpret_cast(dc.GetSafeHdc()), 0); - - // Center icon in client rectangle - int cxIcon = GetSystemMetrics(SM_CXICON); - int cyIcon = GetSystemMetrics(SM_CYICON); - CRect rect; - GetClientRect(&rect); - int x = (rect.Width() - cxIcon + 1) / 2; - int y = (rect.Height() - cyIcon + 1) / 2; - - // Draw the icon - dc.DrawIcon(x, y, m_hIcon); - } - else - { - DrawClient(&dc); -// CDialogEx::OnPaint(); - } -} - -// The system calls this function to obtain the cursor to display while the user drags -// the minimized window. -HCURSOR COpenVideoCallDlg::OnQueryDragIcon() -{ - return static_cast(m_hIcon); -} - - - -LRESULT COpenVideoCallDlg::OnNcHitTest(CPoint point) -{ - // TODO: ڴϢ/Ĭֵ - LRESULT lResult = CDialogEx::OnNcHitTest(point); - if (lResult == HTCLIENT && ::GetAsyncKeyState(MK_LBUTTON) < 0) - lResult = HTCAPTION; - - return lResult; -} - -void COpenVideoCallDlg::DrawClient(CDC *lpDC) -{ - CRect rcText; - CRect rcClient; - LPCTSTR lpString = NULL; - CFont* defFont = lpDC->SelectObject(&m_ftTitle); - - m_imgNetQuality.Draw(lpDC, m_nLastmileQuality, CPoint(16, 40), ILD_NORMAL); - - GetClientRect(&rcClient); - lpDC->FillSolidRect(0, 0, 720, 24, RGB(0, 161, 230)); - lpDC->SetBkColor(RGB(0x00, 0x9E, 0xEB)); - lpDC->SetTextColor(RGB(0xFF, 0xFF, 0xFF)); - lpString = LANG_STR("IDS_TITLE"); - lpDC->TextOut(rcClient.Width()/2 - 80, 3, lpString, _tcslen(lpString)); - - lpDC->SelectObject(&m_ftDes); - lpDC->SetTextColor(RGB(0x91, 0x96, 0xA0)); - lpDC->SetBkColor(RGB(0xFF, 0xFF, 0xFF)); - lpString = LANG_STR("IDS_CONTACT"); - lpDC->TextOut(rcClient.Width() / 2-50, rcClient.Height() - 55, lpString, _tcslen(lpString)); - - lpDC->SelectObject(&m_ftPhone); - lpDC->SetTextColor(RGB(0x44, 0x45, 0x46)); - lpString = LANG_STR("IDS_PHONENUMBER"); - lpDC->TextOut(rcClient.Width() / 2 + 45, rcClient.Height() - 55, lpString, _tcslen(lpString)); - - lpDC->SelectObject(&m_ftDes); - lpDC->SetTextColor(RGB(0x91, 0x96, 0xA0)); - lpDC->SetBkColor(RGB(0xFF, 0xFF, 0xFF)); - lpString = AVC_VER;// _T("v1.3"); - CString strVersion = CAgoraObject::GetSDKVersionEx(); - - rcText.SetRect(0, rcClient.Height() - 30, rcClient.Width(), rcClient.Height() - 5); - lpDC->DrawText(strVersion, _tcslen(strVersion), &rcText, DT_CENTER | DT_SINGLELINE); - lpDC->SelectObject(defFont); -} - -void COpenVideoCallDlg::OnBnClickedBtnmin() -{ - // TODO: ڴӿؼ֪ͨ - ShowWindow(SW_MINIMIZE); -} - - -void COpenVideoCallDlg::OnBnClickedBtnclose() -{ - // TODO: ڴӿؼ֪ͨ - CDialogEx::OnCancel(); -} - -LRESULT COpenVideoCallDlg::OnBackPage(WPARAM wParam, LPARAM lParam) -{ - if (m_lpCurDialog == &m_dlgSetup) { - m_lpCurDialog->ShowWindow(SW_HIDE); - m_lpCurDialog = &m_dlgEnterChannel; - } - - CString str; - - m_dlgSetup.GetVideoSolution(); - m_dlgEnterChannel.SetVideoString(m_dlgSetup.GetVideoSolutionDes()); - - m_lpCurDialog->ShowWindow(SW_SHOW); - - return 0; -} - -LRESULT COpenVideoCallDlg::OnNextPage(WPARAM wParam, LPARAM lParam) -{ - m_lpCurDialog->ShowWindow(SW_HIDE); - if (m_lpCurDialog == &m_dlgEnterChannel) - m_lpCurDialog = &m_dlgSetup; - - m_lpCurDialog->ShowWindow(SW_SHOW); - - return 0; -} - -LRESULT COpenVideoCallDlg::OnJoinChannel(WPARAM wParam, LPARAM lParam) -{ - IRtcEngine *lpRtcEngine = CAgoraObject::GetEngine(); - CAgoraObject *lpAgoraObject = CAgoraObject::GetAgoraObject(); - - CString strChannelName = m_dlgEnterChannel.GetChannelName(); - if (strChannelName.GetLength() == 0) - return 0; - - m_dlgVideo.MoveWindow(0, 0, 960, 720, 1); - m_dlgVideo.ShowWindow(SW_SHOW); - m_dlgVideo.CenterWindow(); - - VideoCanvas vc; - - vc.uid = 0; - vc.view = m_dlgVideo.GetLocalVideoWnd(); - vc.renderMode = RENDER_MODE_TYPE::RENDER_MODE_FIT; - - //cancel setVideoProfile bitrate since version 2.1.0 - m_nVideoSolution = m_dlgSetup.GetVideoSolution(); - lpRtcEngine->setVideoProfile((VIDEO_PROFILE_TYPE)m_nVideoSolution, m_dlgSetup.IsWHSwap()); - lpAgoraObject->EnableVideo(TRUE); - - m_dlgVideo.SetWindowText(strChannelName); - lpRtcEngine->setupLocalVideo(vc); - lpRtcEngine->startPreview(); - - lpAgoraObject->JoinChannel(strChannelName,0, strlen(APP_TOKEN) > 0 ? APP_TOKEN:NULL); - lpAgoraObject->SetMsgHandlerWnd(m_dlgVideo.GetSafeHwnd()); - - return 0; -} - -LRESULT COpenVideoCallDlg::OnLeaveChannel(WPARAM wParam, LPARAM lParam) -{ - CAgoraObject *lpAgoraObject = CAgoraObject::GetAgoraObject(); - - lpAgoraObject->LeaveCahnnel(); - m_dlgEnterChannel.CleanEncryptionSecret(); - - return 0; -} - -LRESULT COpenVideoCallDlg::OnLastmileQuality(WPARAM wParam, LPARAM lParam) -{ - LPAGE_LASTMILE_QUALITY lpData = (LPAGE_LASTMILE_QUALITY)wParam; - - if (m_nLastmileQuality != lpData->quality) { - m_nLastmileQuality = lpData->quality; - InvalidateRect(CRect(16, 40, 48, 72), TRUE); - } - - delete lpData; - return 0; -} \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCallDlg.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCallDlg.h deleted file mode 100644 index 60a018af..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/OpenVideoCallDlg.h +++ /dev/null @@ -1,82 +0,0 @@ - -// AgoraVideoCallDlg.h : header file -// - -#pragma once - -#include "AGHyperlink.h" -#include "EnterChannelDlg.h" -#include "SetupDlg.h" -#include "VideoDlg.h" - -// CAgoraVideoCallDlg dialog -class COpenVideoCallDlg : public CDialogEx -{ -// Construction -public: - COpenVideoCallDlg(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - enum { IDD = IDD_OPENVIDEOCALL_DIALOG }; - - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - - -// Implementation -protected: - HICON m_hIcon; - - // Generated message map functions - virtual BOOL PreTranslateMessage(MSG* pMsg); - virtual BOOL OnInitDialog(); - afx_msg void OnSysCommand(UINT nID, LPARAM lParam); - afx_msg void OnPaint(); - afx_msg HCURSOR OnQueryDragIcon(); - afx_msg LRESULT OnNcHitTest(CPoint point); - - afx_msg void OnBnClickedBtnmin(); - afx_msg void OnBnClickedBtnclose(); - - afx_msg LRESULT OnBackPage(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnNextPage(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnJoinChannel(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnLeaveChannel(WPARAM wParam, LPARAM lParam); - - afx_msg LRESULT OnLastmileQuality(WPARAM wParam, LPARAM lParam); - - - DECLARE_MESSAGE_MAP() - -protected: - void InitCtrls(); - void DrawClient(CDC *lpDC); - void InitChildDialog(); - -private: - CAGButton m_btnMin; - CAGButton m_btnClose; - - CAGHyperLink m_linkAgora; - - CDialogEx *m_lpCurDialog; - CEnterChannelDlg m_dlgEnterChannel; - CSetupDlg m_dlgSetup; - - CFont m_ftTitle; - CFont m_ftLink; - CFont m_ftDes; - CFont m_ftPhone; - CImageList m_imgNetQuality; - -private: - CVideoDlg m_dlgVideo; - CAgoraObject *m_lpAgoraObject; - IRtcEngine *m_lpRtcEngine; - -private: // data - int m_nCodecType; - int m_nVideoSolution; - - int m_nLastmileQuality; -}; diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/SetupDlg.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/SetupDlg.cpp deleted file mode 100644 index e7867d0e..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/SetupDlg.cpp +++ /dev/null @@ -1,277 +0,0 @@ -// SetupDlg.cpp : ʵļ -// - -#include "stdafx.h" -#include "OpenVideoCall.h" -#include "SetupDlg.h" -#include "afxdialogex.h" - - -// CSetupDlg Ի - -IMPLEMENT_DYNAMIC(CSetupDlg, CDialogEx) - -CSetupDlg::CSetupDlg(CWnd* pParent /*=NULL*/) - : CDialogEx(CSetupDlg::IDD, pParent) -{ - -} - -CSetupDlg::~CSetupDlg() -{ -} - -void CSetupDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialogEx::DoDataExchange(pDX); - DDX_Control(pDX, IDC_BTNCONFIRM_SETUP, m_btnConfirm); - DDX_Control(pDX, IDC_BTNCANCEL_SETUP, m_btnCancel); - DDX_Control(pDX, IDC_CKSAVESETTING_SETUP, m_ckSaveSettings); - DDX_Control(pDX, IDC_CKSWPWH_SETUP, m_ckSwapWH); -} - - -BEGIN_MESSAGE_MAP(CSetupDlg, CDialogEx) - ON_WM_PAINT() - ON_BN_CLICKED(IDC_BTNCONFIRM_SETUP, &CSetupDlg::OnBnClickedBtnconfirmSetup) - ON_BN_CLICKED(IDC_BTNCANCEL_SETUP, &CSetupDlg::OnBnClickedBtncancelSetup) -// ON_CBN_SELCHANGE(IDC_CMBRES_SETUP, &CSetupDlg::OnCbnSelchangeCmbresSetup) -// ON_CBN_SELCHANGE(IDC_CMBCODEC_SETUP, &CSetupDlg::OnCbnSelchangeCmbresSetup) - - ON_WM_HSCROLL() - ON_WM_LBUTTONDBLCLK() - -END_MESSAGE_MAP() - - -// CSetupDlg Ϣ - - -BOOL CSetupDlg::OnInitDialog() -{ - CDialogEx::OnInitDialog(); - - // TODO: ڴӶijʼ - m_ftHead.CreateFont(15, 0, 0, 0, FW_NORMAL, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, _T("Arial")); - m_ftDes.CreateFont(15, 0, 0, 0, FW_NORMAL, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, _T("Arial")); - m_ftBtn.CreateFont(16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, _T("Arial")); - m_penFrame.CreatePen(PS_SOLID, 1, RGB(0xD8, 0xD8, 0xD8)); - - m_cbxVideoProfile.Create(WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST, CRect(0, 0, 300, 40), this, IDC_CMBVDOPRF_SETUP); - SetBackgroundColor(RGB(0xFF, 0xFF, 0xFF), TRUE); - InitData(); - InitCtrls(); - - if (m_agConfig.IsAutoSaveEnabled()) - m_ckSaveSettings.SetCheck(TRUE); - else - m_ckSaveSettings.SetCheck(FALSE); - - return TRUE; // return TRUE unless you set the focus to a control - // 쳣: OCX ҳӦ FALSE -} - - -void CSetupDlg::InitCtrls() -{ - CRect ClientRect; - - MoveWindow(0, 0, 320, 450, 1); - GetClientRect(&ClientRect); - - int nResolutionIndex = 0; - CString str; - - m_cbxVideoProfile.MoveWindow(210, 125, 200, 22, TRUE); - m_cbxVideoProfile.SetFont(&m_ftDes); - m_cbxVideoProfile.SetButtonImage(IDB_CMBBTN, 12, 12, RGB(0xFF, 0x00, 0xFF)); - m_cbxVideoProfile.SetFaceColor(RGB(0xFF, 0xFF, 0xFF), RGB(0xFF, 0xFF, 0xFF)); - m_cbxVideoProfile.SetListMaxHeight(600); - - m_ckSwapWH.MoveWindow(75, 160, 20, 20, TRUE); - m_ckSaveSettings.MoveWindow(185, ClientRect.Height() - 120, 20, 20, TRUE); - - m_btnCancel.MoveWindow(ClientRect.Width() / 2 - 93, ClientRect.Height() - 58, 174, 36, TRUE); - m_btnConfirm.MoveWindow(ClientRect.Width() / 2 + 93, ClientRect.Height() - 58, 174, 36, TRUE); - - for (int nIndex = 0; nIndex < 31; nIndex++) { - m_cbxVideoProfile.InsertString(nIndex, m_szProfileDes[nIndex]); - m_cbxVideoProfile.SetItemData(nIndex, (DWORD_PTR)m_nProfileValue[nIndex]); - } - - m_btnCancel.SetBorderColor(RGB(0xD8, 0xD8, 0xD8), RGB(0x00, 0xA0, 0xE9), RGB(0x00, 0xA0, 0xE9), RGB(0xCC, 0xCC, 0xCC)); - m_btnCancel.SetBackColor(RGB(0xFF, 0xFF, 0xFF), RGB(0xFF, 0xFF, 0xFF), RGB(0xFF, 0xFF, 0xFF), RGB(0xFF, 0xFF, 0xFF)); - m_btnCancel.SetTextColor(RGB(0x55, 0x58, 0x5A), RGB(0x00, 0xA0, 0xE9), RGB(0x00, 0xA0, 0xE9), RGB(0xCC, 0xCC, 0xCC)); - - m_btnConfirm.SetBackColor(RGB(0, 160, 239), RGB(0, 160, 239), RGB(0, 160, 239), RGB(192, 192, 192)); - m_btnConfirm.SetFont(&m_ftBtn); - m_btnConfirm.SetTextColor(RGB(0xFF, 0xFF, 0xFF), RGB(0xFF, 0xC8, 0x64), RGB(0xFF, 0xC8, 0x64), RGB(0xCC, 0xCC, 0xCC)); - m_btnConfirm.SetWindowText(LANG_STR("IDS_SET_BTCONFIRM")); - - if (m_agConfig.IsAutoSaveEnabled()) - nResolutionIndex = m_agConfig.GetSolution(); - else - nResolutionIndex = 15; - - m_cbxVideoProfile.SetCurSel(nResolutionIndex); -} - -void CSetupDlg::InitData() -{ - m_szProfileDes[0] = _T("160x120 15fps"); //65kbps - m_nProfileValue[0] = 0; - m_szProfileDes[1] = _T("120x120 15fps"); //50kbps - m_nProfileValue[1] = 2; - - m_szProfileDes[2] = _T("320x180 15fps"); //140kbps - m_nProfileValue[2] = 10; - m_szProfileDes[3] = _T("180x180 15fps"); //100kbps - m_nProfileValue[3] = 12; - m_szProfileDes[4] = _T("240x180 15fps"); //120kbps - m_nProfileValue[4] = 13; - - m_szProfileDes[5] = _T("320x240 15fps"); //200kbps - m_nProfileValue[5] = 20; - m_szProfileDes[6] = _T("240x240 15fps"); //140kbps - m_nProfileValue[6] = 22; - m_szProfileDes[7] = _T("424x240 15fps"); //220kbps - m_nProfileValue[7] = 23; - - m_szProfileDes[8] = _T("640x360 15fps"); //400kbps - m_nProfileValue[8] = 30; - m_szProfileDes[9] = _T("360x360 15fps"); //260kbps - m_nProfileValue[9] = 32; - m_szProfileDes[10] = _T("640x360 30fps"); //600kbps - m_nProfileValue[10] = 33; - m_szProfileDes[11] = _T("360x360 30fps"); //400kbps - m_nProfileValue[11] = 35; - m_szProfileDes[12] = _T("480x360 15fps"); //320kbps - m_nProfileValue[12] = 36; - m_szProfileDes[13] = _T("480x360 30fps"); //490kbps - m_nProfileValue[13] = 37; - m_szProfileDes[14] = _T("640x360 15fps"); //800kbps - m_nProfileValue[14] = 38; - - m_szProfileDes[15] = _T("640x480 15fps"); //500kbps - m_nProfileValue[15] = 40; - m_szProfileDes[16] = _T("480x480 15fps"); //400kbps - m_nProfileValue[16] = 42; - m_szProfileDes[17] = _T("640x480 30fps"); //750kbps - m_nProfileValue[17] = 43; - m_szProfileDes[18] = _T("480x480 30fps"); //600kbps - m_nProfileValue[18] = 44; - m_szProfileDes[19] = _T("848x480 15fps"); //610kbps - m_nProfileValue[19] = 47; - m_szProfileDes[20] = _T("848x480 30fps"); //930kbps - m_nProfileValue[20] = 48; - - m_szProfileDes[21] = _T("1280x720 15fps"); //1130kbps - m_nProfileValue[21] = 50; - m_szProfileDes[22] = _T("1280x720 30fps"); //1710kbps - m_nProfileValue[22] = 52; - m_szProfileDes[23] = _T("960x720 15fps"); //910kbps - m_nProfileValue[23] = 54; - m_szProfileDes[24] = _T("960x720 30fps"); //1380kbps - m_nProfileValue[24] = 55; - - m_szProfileDes[25] = _T("1920x1080 15fps"); //2080kbps - m_nProfileValue[25] = 60; - m_szProfileDes[26] = _T("1920x1080 30fps"); //3150kbps - m_nProfileValue[26] = 62; - m_szProfileDes[27] = _T("1920x1080 60fps"); //4780kbps - m_nProfileValue[27] = 64; - m_szProfileDes[28] = _T("2560x1440 30fps"); //4850kbps - m_nProfileValue[28] = 66; - m_szProfileDes[29] = _T("3560x1440 60fps"); //7350kbps - m_nProfileValue[29] = 67; - - m_szProfileDes[30] = _T("3840x2160 30fps"); //8190kbps - m_nProfileValue[30] = 70; - m_szProfileDes[31] = _T("3840x2160 60fps"); //13500kbps - m_nProfileValue[31] = 72; -} - -void CSetupDlg::DrawClient(CDC *lpDC) -{ - CRect rcText; - CRect rcClient; - LPCTSTR lpString = NULL; - - GetClientRect(&rcClient); - - CFont* defFont = lpDC->SelectObject(&m_ftHead); - - lpDC->SelectObject(&m_penFrame); - rcText.SetRect(rcClient.Width() / 2 - 188, 120, rcClient.Width() / 2 + 172, 152); - lpDC->RoundRect(&rcText, CPoint(32, 32)); - - lpDC->SetBkColor(RGB(0xFF, 0xFF, 0xFF)); - lpDC->SetTextColor(RGB(0xD8, 0xD8, 0xD8)); - lpString = LANG_STR("IDS_SET_RESOLUTION"); - lpDC->TextOut(75, 128, lpString, _tcslen(lpString)); - - lpDC->SetTextColor(RGB(0x44, 0x45, 0x46)); - lpString = LANG_STR("IDS_SET_SWAPWH"); - lpDC->TextOut(100, 160, lpString, _tcslen(lpString)); - - lpString = LANG_STR("IDS_SET_SAVESETTING"); - lpDC->TextOut(205, rcClient.Height() - 118, lpString, _tcslen(lpString)); - - lpDC->SelectObject(defFont); -} - -void CSetupDlg::OnBnClickedBtnconfirmSetup() -{ - // TODO: ڴӿؼ֪ͨ - GetParent()->SendMessage(WM_GOBACK, 0, 0); - - if (m_ckSaveSettings.GetCheck() == TRUE) { - m_agConfig.EnableAutoSave(TRUE); - m_agConfig.SetSolution(m_cbxVideoProfile.GetCurSel()); - } - else - m_agConfig.EnableAutoSave(FALSE); -} - -void CSetupDlg::OnBnClickedBtncancelSetup() -{ - GetParent()->SendMessage(WM_GOBACK, 0, 0); -} - -void CSetupDlg::OnPaint() -{ - CPaintDC dc(this); // device context for painting - - DrawClient(&dc); -} - -int CSetupDlg::GetVideoSolution() -{ - int nIndex = m_cbxVideoProfile.GetCurSel(); - - return (int)m_cbxVideoProfile.GetItemData(nIndex); -} - -void CSetupDlg::SetVideoSolution(int nIndex) -{ - m_cbxVideoProfile.SetCurSel(nIndex); -} - -CString CSetupDlg::GetVideoSolutionDes() -{ - int nIndex = m_cbxVideoProfile.GetCurSel(); - if (nIndex == -1) - nIndex = 0; - - return (CString)m_szProfileDes[nIndex]; -} - -void CSetupDlg::SetWHSwap(BOOL bSwap) -{ - m_ckSwapWH.SetCheck(bSwap); -} - -BOOL CSetupDlg::IsWHSwap() -{ - return (BOOL)m_ckSwapWH.GetCheck(); -} \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/SetupDlg.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/SetupDlg.h deleted file mode 100644 index 05fc8a96..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/SetupDlg.h +++ /dev/null @@ -1,71 +0,0 @@ -#pragma once -#include "AGButton.h" -#include "AGComboBox.h" -#include "AGSliderCtrl.h" -#include "afxwin.h" - -#include "AGConfig.h" -// CSetupDlg Ի - -class CSetupDlg : public CDialogEx -{ - - DECLARE_DYNAMIC(CSetupDlg) - -public: - CSetupDlg(CWnd* pParent = NULL); // ׼캯 - virtual ~CSetupDlg(); - - void SetVideoSolution(int nIndex); - int GetVideoSolution(); - CString GetVideoSolutionDes(); - - void SetWHSwap(BOOL bSwap); - BOOL IsWHSwap(); - -// Ի - enum { IDD = IDD_SETUP_DIALOG }; - - typedef struct _AGVIDEO_PARAM - { - int nWidth; - int nHeight; - int nMinKPB; - int nMaxKPB; - - } AGNET_RATE_RANGE; - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ - virtual BOOL OnInitDialog(); - - afx_msg void OnPaint(); - afx_msg void OnBnClickedBtnconfirmSetup(); - afx_msg void OnBnClickedBtncancelSetup(); - DECLARE_MESSAGE_MAP() - -protected: - void InitCtrls(); - void InitData(); - void DrawClient(CDC *lpDC); - -private: - CAGButton m_btnCancel; - CAGButton m_btnConfirm; - CButton m_ckSwapWH; - CButton m_ckSaveSettings; - - CAGComboBox m_cbxVideoProfile; - - CFont m_ftHead; // title - CFont m_ftDes; // text in ctrl - CFont m_ftBtn; // button - CPen m_penFrame; - - LPTSTR m_szProfileDes[64]; - int m_nProfileValue[64]; - AGNET_RATE_RANGE m_agRateRange[13]; - -private: - CAGConfig m_agConfig; -}; diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/VideoDlg.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/VideoDlg.cpp deleted file mode 100644 index 031284a8..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/VideoDlg.cpp +++ /dev/null @@ -1,1230 +0,0 @@ -// VideoDlg.cpp -// - -#include "stdafx.h" -#include "OpenVideoCall.h" -#include "VideoDlg.h" -#include "afxdialogex.h" -#include "AGEventDef.h" -#include "video_preprocessing_plugin.h" - -// CVideoDlg - -IMPLEMENT_DYNAMIC(CVideoDlg, CDialogEx) - -CVideoDlg::CVideoDlg(CWnd* pParent /*=NULL*/) - : CDialogEx(CVideoDlg::IDD, pParent) -{ - m_brHead.CreateSolidBrush(RGB(0, 160, 239)); - SetBackgroundColor(RGB(0x26, 0x26, 0x26)); - m_bLastStat = FALSE; - m_nScreenMode = SCREEN_VIDEO1; - m_bFullScreen = FALSE; - m_lpBigShowed = NULL; - m_bFilter = FALSE; - m_bShowInfo = FALSE; -} - -CVideoDlg::~CVideoDlg() -{ - m_brHead.DeleteObject(); -} - -void CVideoDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialogEx::DoDataExchange(pDX); - - DDX_Control(pDX, IDC_BTNMIN_VIDEO, m_btnMin); - DDX_Control(pDX, IDC_BTNRSTO_VIDEO, m_btnRst); - DDX_Control(pDX, IDC_BTNCLOSE_VIDEO, m_btnClose); -} - - -BEGIN_MESSAGE_MAP(CVideoDlg, CDialogEx) - ON_WM_SIZE() - ON_WM_MOUSEMOVE() - ON_WM_PAINT() - ON_WM_NCHITTEST() - - ON_MESSAGE(WM_SHOWMODECHANGED, &CVideoDlg::OnShowModeChanged) - ON_MESSAGE(WM_SHOWBIG, &CVideoDlg::OnShowBig) - - ON_MESSAGE(WM_WINDOWSHARE, &CVideoDlg::OnWindowShareStart) - ON_MESSAGE(WM_DESKTOPSHARE, &CVideoDlg::OnDesktopShareStart) - - ON_MESSAGE(WM_MSGID(EID_JOINCHANNEL_SUCCESS), &CVideoDlg::OnEIDJoinChannelSuccess) - ON_MESSAGE(WM_MSGID(EID_REJOINCHANNEL_SUCCESS), &CVideoDlg::OnEIDReJoinChannelSuccess) - ON_MESSAGE(WM_MSGID(EID_FIRST_LOCAL_VIDEO_FRAME), &CVideoDlg::OnEIDFirstLocalFrame) - - ON_MESSAGE(WM_MSGID(EID_FIRST_REMOTE_VIDEO_DECODED), &CVideoDlg::OnEIDFirstRemoteFrameDecoded) - ON_MESSAGE(WM_MSGID(EID_USER_OFFLINE), &CVideoDlg::OnEIDUserOffline) - - ON_MESSAGE(WM_MSGID(EID_REMOTE_VIDEO_STAT), &CVideoDlg::OnRemoteVideoStat) - - ON_MESSAGE(WM_MSGID(EID_START_RCDSRV), &CVideoDlg::OnStartRecordingService) - ON_MESSAGE(WM_MSGID(EID_STOP_RCDSRV), &CVideoDlg::OnStopRecordingService) - - ON_MESSAGE(WM_MSGID(EID_STREAM_MESSAGE), &CVideoDlg::OnStreamMessage) - - - ON_BN_CLICKED(IDC_BTNMIN_VIDEO, &CVideoDlg::OnBnClickedBtnmin) - ON_BN_CLICKED(IDC_BTNCLOSE_VIDEO, &CVideoDlg::OnBnClickedBtnclose) - ON_BN_CLICKED(IDC_BTNRSTO_VIDEO, &CVideoDlg::OnBnClickedBtnrest) - ON_BN_CLICKED(IDC_BTNENDCALL_VIDEO, &CVideoDlg::OnBnClickedBtnclose) - - ON_BN_CLICKED(IDC_BTNMESSAGE_VIDEO, &CVideoDlg::OnBnClickedBtnmessage) - - ON_BN_CLICKED(IDC_BTNSCRCAP_VIDEO, &CVideoDlg::OnBnClickedBtnScreenCapture) - ON_BN_CLICKED(IDC_BTNMORE_VIDEO, &CVideoDlg::OnBnClickedBtnMore) - ON_BN_CLICKED(IDC_BTNMODE_VIDEO, &CVideoDlg::OnBnClickedBtnmode) - ON_BN_CLICKED(IDC_BTNAUDIO_VIDEO, &CVideoDlg::OnBnClickedBtnaudio) - - ON_BN_CLICKED(ID_IDR_VIDEOINFO, &CVideoDlg::OnBnClickedBtntip) - ON_BN_CLICKED(ID_IDR_DEVICE, &CVideoDlg::OnBnClickedBtnsetup) - ON_BN_CLICKED(ID_IDR_FILTER, &CVideoDlg::OnBnClickedBtnfilter) - -// ON_BN_CLICKED(IDC_BTNWHITEBOARD_VIDEO, &CVideoDlg::OnBnCliekedBtnWhiteBoard) -// ON_BN_CLICKED(IDC_BTNCLOSEWB_VIDEO, &CVideoDlg::OnBnCliekedBtnCloseWhiteBoard) - - ON_BN_CLICKED(IDC_BTNSCR_VIDEO, &CVideoDlg::OnBnClickedBtnfullscr) - - ON_BN_CLICKED(ID_SCRSHARE_DESKTOPSHARE, &CVideoDlg::OnBnClickedScreenshare) - ON_BN_CLICKED(ID_SCRSHARE_WINDOWSHARE, &CVideoDlg::OnBnClickedWindowshare) - -// ON_BN_CLICKED(ID_WHITEBOARD_HOSTMODE, &CVideoDlg::OnBnClickedHostMode) -// ON_BN_CLICKED(ID_WHITEBOARD_GUESTMODE, &CVideoDlg::OnBnClickedGuestMode) - ON_WM_SHOWWINDOW() - ON_WM_MOVE() -END_MESSAGE_MAP() - - -// CVideoDlg - - -void CVideoDlg::OnSize(UINT nType, int cx, int cy) -{ - CDialogEx::OnSize(nType, cx, cy); - - if (m_btnMin.GetSafeHwnd() != NULL) - m_btnMin.MoveWindow(cx - 72, 0, 24, 24, TRUE); - if (m_btnRst.GetSafeHwnd() != NULL) - m_btnRst.MoveWindow(cx - 48, 0, 24, 24, TRUE); - if (m_btnClose.GetSafeHwnd() != NULL) - m_btnClose.MoveWindow(cx - 24, 0, 24, 24, TRUE); - - GetClientRect(&m_rcVideoArea); - m_rcVideoArea.top += 24; - m_rcVideoArea.bottom -= 72; - - m_rcChildVideoArea.top = m_rcVideoArea.top + 10; - m_rcChildVideoArea.bottom = m_rcChildVideoArea.top + 144; - m_rcChildVideoArea.right = m_rcVideoArea.right - 14; - m_rcChildVideoArea.left = m_rcChildVideoArea.right - 192; - - if (::IsWindow(m_dlgChat.GetSafeHwnd()) && m_dlgChat.IsWindowVisible()) { - CRect rcChatArea; - - rcChatArea.CopyRect(&m_rcVideoArea); - rcChatArea.top = rcChatArea.bottom - 150; - ClientToScreen(&rcChatArea); - m_dlgChat.MoveWindow(&rcChatArea); - } - - if (m_wndLocal.GetSafeHwnd() == NULL || m_wndVideo[0].GetSafeHwnd() == NULL) - return; - - switch (m_nScreenMode) - { - case SCREEN_VIDEO1: - AdjustSizeVideo1(cx, cy); - AdjustButtonsNormal(cx, cy); - break; - case SCREEN_VIDEO4: - AdjustSizeVideo4(cx, cy); - AdjustButtonsNormal(cx, cy); - break; - case SCREEN_VIDEOMULTI: - AdjustSizeVideoMulti(cx, cy); - AdjustButtonsNormal(cx, cy); - break; - default: - break; - } - - Invalidate(TRUE); -} - -void CVideoDlg::ShowButtonsNormal() -{ - CRect rcClient; - int nShowMode = SW_HIDE; - - if (!m_bFullScreen) - nShowMode = SW_SHOW; - - m_btnMessage.ShowWindow(nShowMode); - m_btnMode.ShowWindow(nShowMode); - m_btnMore.ShowWindow(nShowMode); - - m_btnAudio.SetBackImage(IDB_BTNMAUDIO_VIDEO, RGB(0x26, 0x26, 0x26)); - m_btnAudio.ShowWindow(nShowMode); - m_btnEndCall.SetBackImage(IDB_BTNENDCALL_VIDEO, RGB(0x26, 0x26, 0x26)); - m_btnEndCall.ShowWindow(nShowMode); - m_btnScrCap.ShowWindow(nShowMode); - m_btnShow.ShowWindow(nShowMode); - - GetClientRect(&rcClient); - AdjustButtonsNormal(rcClient.Width(), rcClient.Height()); -} - - -void CVideoDlg::AdjustButtonsNormal(int cx, int cy) -{ -// if (m_btnSetup.GetSafeHwnd() != NULL) -// m_btnSetup.MoveWindow(30, cy - 48, 24, 24, TRUE); - - if(m_btnMessage.GetSafeHwnd() != NULL) - m_btnMessage.MoveWindow(cx / 2 - 312, cy - 60, 48, 48, TRUE); - if (m_btnMode.GetSafeHwnd() != NULL) - m_btnMode.MoveWindow(cx / 2 - 216, cy - 60, 48, 48, TRUE); - if (m_btnAudio.GetSafeHwnd() != NULL) - m_btnAudio.MoveWindow(cx / 2 - 120, cy - 60, 48, 48, TRUE); - if (m_btnEndCall.GetSafeHwnd() != NULL) - m_btnEndCall.MoveWindow(cx / 2 - 24, cy - 60, 48, 48, TRUE); - - if (m_btnScrCap.GetSafeHwnd() != NULL) - m_btnScrCap.MoveWindow(cx / 2 + 72, cy - 60, 48, 48, TRUE); - if (m_btnMore.GetSafeHwnd() != NULL) - m_btnMore.MoveWindow(cx / 2 + 264, cy - 60, 48, 48, TRUE); - - if (m_btnShow.GetSafeHwnd() != NULL) - m_btnShow.MoveWindow(cx - 72, cy - 48, 48, 48, TRUE); -} - -void CVideoDlg::AdjustSizeVideo1(int cx, int cy) -{ - if (m_listWndInfo.GetCount() == 0) - m_wndLocal.MoveWindow(&m_rcVideoArea, FALSE); - else { - m_wndVideo[0].MoveWindow(&m_rcVideoArea, FALSE); - m_wndLocal.MoveWindow(&m_rcChildVideoArea, FALSE); - } -} - -void CVideoDlg::AdjustSizeVideo4(int cx, int cy) -{ - m_wndVideo[0].MoveWindow(0, m_rcVideoArea.top, m_rcVideoArea.Width() / 2, m_rcVideoArea.Height() / 2, FALSE); - m_wndVideo[1].MoveWindow(m_rcVideoArea.Width() / 2, m_rcVideoArea.top, m_rcVideoArea.Width() / 2, m_rcVideoArea.Height() / 2, FALSE); - m_wndVideo[2].MoveWindow(0, m_rcVideoArea.top + m_rcVideoArea.Height() / 2, m_rcVideoArea.Width() / 2, m_rcVideoArea.Height() / 2, FALSE); - m_wndVideo[3].MoveWindow(m_rcVideoArea.Width() / 2, m_rcVideoArea.top + m_rcVideoArea.Height() / 2, m_rcVideoArea.Width() / 2, m_rcVideoArea.Height() / 2, FALSE); - - if (m_listWndInfo.GetCount() == 2) - m_wndLocal.MoveWindow(0, m_rcVideoArea.top + m_rcVideoArea.Height() / 2, m_rcVideoArea.Width() / 2, m_rcVideoArea.Height() / 2, FALSE); - else - m_wndLocal.MoveWindow(m_rcVideoArea.Width() / 2, m_rcVideoArea.top + m_rcVideoArea.Height() / 2, m_rcVideoArea.Width() / 2, m_rcVideoArea.Height() / 2, FALSE); -} - -void CVideoDlg::AdjustSizeVideoMulti(int cx, int cy) -{ - int nLocalIndex = 0; - - m_lpBigShowed->MoveWindow(&m_rcVideoArea, TRUE); - - for (int nIndex = 0; nIndex < 4; nIndex++) { - int nXPos = (m_rcVideoArea.Width() / 2) - 402 + (204 * nLocalIndex); - int nYPos = m_rcVideoArea.top + 16; - - if (!m_wndVideo[nIndex].IsBigShow()) { - if (m_wndVideo[nIndex].GetUID() != 0) { - m_wndVideo[nIndex].MoveWindow(nXPos, nYPos, 192, 144, TRUE); - nLocalIndex++; - } - } - else{ - m_wndLocal.MoveWindow(nXPos, nYPos, 192, 144, TRUE); - nLocalIndex++; - } - } -} - -void CVideoDlg::OnMouseMove(UINT nFlags, CPoint point) -{ - CDialogEx::OnMouseMove(nFlags, point); -} - -BOOL CVideoDlg::NeedShowSizeBox(CPoint point) -{ - CRect rcClient; - - GetClientRect(&rcClient); - - rcClient.left += 5; - rcClient.right -= 5; - rcClient.top += 5; - rcClient.bottom -= 5; - - if (rcClient.PtInRect(point) || IsZoomed()) - return FALSE; - - return TRUE; -} - -void CVideoDlg::EnableSize(BOOL bEnable) -{ - LONG lStyle = ::GetWindowLong(GetSafeHwnd(), GWL_STYLE); - - if (bEnable) - ::SetWindowLong(GetSafeHwnd(), GWL_STYLE, lStyle | WS_SIZEBOX); - else - ::SetWindowLong(GetSafeHwnd(), GWL_STYLE, lStyle&(~WS_SIZEBOX)); - - CRect rcClient; - - if (bEnable) - GetWindowRect(&rcClient); - else - GetClientRect(&rcClient); - - int cx = rcClient.Width(); - int cy = rcClient.Height(); - - if (m_bLastStat != bEnable) { - m_bLastStat = bEnable; - if (m_btnMin.GetSafeHwnd() != NULL) - m_btnMin.MoveWindow(cx - 72, 0, 24, 24, TRUE); - if (m_btnRst.GetSafeHwnd() != NULL) - m_btnRst.MoveWindow(cx - 48, 0, 24, 24, TRUE); - if (m_btnClose.GetSafeHwnd() != NULL) - m_btnClose.MoveWindow(cx - 24, 0, 24, 24, TRUE); - -// if (m_btnTip.GetSafeHwnd() != NULL) -// m_btnTip.MoveWindow(cx / 2 - 372, cy - 84, 72, 72, TRUE); - - if (m_btnScrCap.GetSafeHwnd() != NULL) - m_btnScrCap.MoveWindow(48, cy - 84, 48, 48, TRUE); - -// if (m_btnSetup.GetSafeHwnd() != NULL) -// m_btnSetup.MoveWindow(cx / 2 - 216, cy - 84, 72, 72, TRUE); - if (m_btnMode.GetSafeHwnd() != NULL) - m_btnMode.MoveWindow(cx / 2 - 96, cy - 84, 48, 48, TRUE); - if (m_btnAudio.GetSafeHwnd() != NULL) - m_btnAudio.MoveWindow(cx / 2 + 24, cy - 84, 48, 48, TRUE); - if (m_btnShow.GetSafeHwnd() != NULL) - m_btnShow.MoveWindow(cx - 72, cy - 84, 48, 48, TRUE); - if (m_btnEndCall.GetSafeHwnd() != NULL) - m_btnEndCall.MoveWindow(cx - 120, cy - 84, 48, 48, TRUE); - - Invalidate(FALSE); - } -} - -void CVideoDlg::OnPaint() -{ - CPaintDC dc(this); // device context for painting - //CDialogEx::OnPaint() - DrawHead(&dc); -} - - -LRESULT CVideoDlg::OnNcHitTest(CPoint point) -{ - LRESULT lResult = CDialogEx::OnNcHitTest(point); - if (lResult == HTCLIENT && ::GetAsyncKeyState(MK_LBUTTON) < 0) - lResult = HTCAPTION; - - return lResult; -} - -void CVideoDlg::OnBnClickedBtnmin() -{ - ShowWindow(SW_MINIMIZE); -} - -void CVideoDlg::OnBnClickedBtnclose() -{ - GetParent()->SendMessage(WM_LEAVECHANNEL, 0, 0); - - m_listWndInfo.RemoveAll(); - m_dlgChat.ShowWindow(SW_HIDE); - m_dlgDevice.ShowWindow(SW_HIDE); - - // unmute local video - CAgoraObject::GetAgoraObject()->MuteLocalVideo(FALSE); - m_btnMode.SetBackImage(IDB_BTNAUDIO_VIDEO); - - // unmute local audio - CAgoraObject::GetAgoraObject()->MuteLocalAudio(FALSE); - m_btnAudio.SwitchButtonStatus(CAGButton::AGBTN_NORMAL); - - CAgoraObject::GetAgoraObject()->EnableScreenCapture(NULL, 0, NULL, FALSE); - m_btnScrCap.SwitchButtonStatus(CAGButton::AGBTN_NORMAL); - - m_dlgChat.ShowWindow(SW_HIDE); - m_dlgChat.ClearHistory(); - m_btnMessage.SwitchButtonStatus(CAGButton::AGBTN_NORMAL); - - CDialogEx::OnOK(); -} - -void CVideoDlg::OnBnClickedBtnrest() -{ - if (IsZoomed()) { - m_btnRst.SetBackImage(IDB_BTNMAX, RGB(0xFF, 0x00, 0xFF)); - ShowWindow(SW_RESTORE); - } - else{ - m_btnRst.SetBackImage(IDB_BTNRESTORE, RGB(0xFF, 0x00, 0xFF)); - ShowWindow(SW_MAXIMIZE); - } - - CRect rcClient; - - GetClientRect(&rcClient); - m_rcVideoArea.CopyRect(&rcClient); - m_rcVideoArea.top += 24; - m_rcVideoArea.bottom -= 72; - - m_rcChildVideoArea.top = m_rcVideoArea.top + 16; - m_rcChildVideoArea.bottom = m_rcChildVideoArea.top + 144; - m_rcChildVideoArea.left = m_rcVideoArea.right - 212; - m_rcChildVideoArea.right = m_rcVideoArea.right - 20; - - int cx = rcClient.Width(); - int cy = rcClient.Height(); - - switch (m_nScreenMode) - { - case SCREEN_VIDEO1: - AdjustSizeVideo1(cx, cy); - AdjustButtonsNormal(cx, cy); - break; - case SCREEN_VIDEO4: - AdjustSizeVideo4(cx, cy); - AdjustButtonsNormal(cx, cy); - break; - case SCREEN_VIDEOMULTI: - AdjustSizeVideoMulti(cx, cy); - AdjustButtonsNormal(cx, cy); - break; - default: - break; - } - - Invalidate(TRUE); -} - - -void CVideoDlg::OnBnClickedBtnfullscr() -{ - int nShowMode = 0; - - if (m_bFullScreen) { - m_bFullScreen = FALSE; - nShowMode = SW_SHOW; - ShowWindow(SW_RESTORE); - - GetClientRect(&m_rcVideoArea); - m_rcVideoArea.top += 24; - m_rcVideoArea.bottom -= 72; - } - else{ - m_bFullScreen = TRUE; - nShowMode = SW_HIDE; - ShowWindow(SW_MAXIMIZE); - - GetClientRect(&m_rcVideoArea); - } - - m_btnMin.ShowWindow(nShowMode); - m_btnRst.ShowWindow(nShowMode); - m_btnClose.ShowWindow(nShowMode); - - m_btnMessage.ShowWindow(nShowMode); - m_btnMode.ShowWindow(nShowMode); - m_btnAudio.ShowWindow(nShowMode); - m_btnEndCall.ShowWindow(nShowMode); - m_btnScrCap.ShowWindow(nShowMode); - m_btnMore.ShowWindow(nShowMode); - - m_btnShow.ShowWindow(nShowMode); - - switch (m_nScreenMode) - { - case SCREEN_VIDEO1: - ShowVideo1(); - break; - case SCREEN_VIDEO4: - ShowVideo4(); - break; - case SCREEN_VIDEOMULTI: - ShowMulti(); - break; - default: - break; - } - - Invalidate(TRUE); -} - -void CVideoDlg::OnBnClickedScreenshare() -{ - m_dlgDesktopCapture.SaveScreen(NULL); - m_dlgDesktopCapture.ShowWindow(SW_MAXIMIZE); -} - -void CVideoDlg::OnBnClickedWindowshare() -{ - m_dlgScreenCapture.RefreashWndInfo(); - m_dlgScreenCapture.SaveScreen(NULL); - - m_dlgScreenCapture.ShowWindow(SW_MAXIMIZE); -} - -void CVideoDlg::ShowControlButton(BOOL bShow) -{ - int nShowMode = 0; - if (bShow) - nShowMode = SW_SHOW; - else - nShowMode = SW_HIDE; - - m_btnScrCap.ShowWindow(nShowMode); - m_btnMessage.ShowWindow(nShowMode); - m_btnMode.ShowWindow(nShowMode); - m_btnMore.ShowWindow(nShowMode); - m_btnAudio.ShowWindow(nShowMode); - m_btnShow.ShowWindow(nShowMode); - m_btnEndCall.ShowWindow(nShowMode); -} - -void CVideoDlg::OnBnClickedBtntip() -{ - for (int nIndex = 0; nIndex < 4; nIndex++) - m_wndVideo[nIndex].ShowVideoInfo(!m_bShowInfo); - - m_bShowInfo = !m_bShowInfo; -} - -void CVideoDlg::OnBnClickedBtnScreenCapture() -{ - CAgoraObject *lpAgora = CAgoraObject::GetAgoraObject(); - - if (lpAgora->IsScreenCaptureEnabled()) { - lpAgora->EnableScreenCapture(NULL, 0, NULL, FALSE); - m_btnScrCap.SwitchButtonStatus(CAGButton::AGBTN_NORMAL); - CAgoraObject::GetAgoraObject()->EnableLocalRender(TRUE); - } - else - CreateScreenShareMenu(); - - Invalidate(); -} - -void CVideoDlg::OnBnClickedBtnMore() -{ - CreateMoreMenu(); -} - -void CVideoDlg::CreateScreenShareMenu() -{ - CRect rcButton; - CMenu Menu; - MENUITEMINFO mii; - - Menu.LoadMenu(IDR_MENU_SCRSHARE); - - CMenu *pMenuPopup = Menu.GetSubMenu(0); - - mii.cbSize = sizeof(MENUITEMINFO); - mii.fMask = MIIM_STRING; - - mii.dwTypeData = const_castLANG_STR("IDS_VIDEO_SCRSHARE"); - mii.cch = _tcslen(LANG_STR("IDS_VIDEO_SCRSHARE")) + 1; - pMenuPopup->SetMenuItemInfo(0, &mii, FALSE); - - mii.dwTypeData = const_castLANG_STR("IDS_VIDEO_WNDSHARE"); - mii.cch = _tcslen(LANG_STR("IDS_VIDEO_WNDSHARE")) + 1; - pMenuPopup->SetMenuItemInfo(1, &mii, FALSE); - m_btnScrCap.GetWindowRect(&rcButton); - - int x = rcButton.left - 60; - int y = rcButton.top - 50; - - pMenuPopup->TrackPopupMenu(TPM_RIGHTBUTTON, x, y, this); - pMenuPopup->DestroyMenu(); -} - - -void CVideoDlg::CreateMoreMenu() -{ - CRect rcButton; - CMenu Menu; - MENUITEMINFO mii; - UINT nFlag = 0; - - Menu.LoadMenu(IDR_MENU_MORE); - - CMenu *pMenuPopup = Menu.GetSubMenu(0); - - mii.cbSize = sizeof(MENUITEMINFO); - mii.fMask = MIIM_STRING; - - mii.dwTypeData = const_castLANG_STR("IDS_VIDEO_MOREINFO"); - mii.cch = _tcslen(LANG_STR("IDS_VIDEO_MOREINFO")) + 1; - pMenuPopup->SetMenuItemInfo(0, &mii, FALSE); - pMenuPopup->SetMenuItemBitmaps(ID_IDR_VIDEOINFO, MF_BYCOMMAND, &m_bitMenuInfo, &m_bitMenuInfo); - if (m_bShowInfo) - nFlag = MF_BYCOMMAND | MF_CHECKED; - else - nFlag = MF_BYCOMMAND | MF_UNCHECKED; - pMenuPopup->CheckMenuItem(ID_IDR_VIDEOINFO, nFlag); - - mii.dwTypeData = const_castLANG_STR("IDS_VIDEO_MOREDEVICE"); - mii.cch = _tcslen(LANG_STR("IDS_VIDEO_MOREDEVICE")) + 1; - pMenuPopup->SetMenuItemInfo(1, &mii, FALSE); - pMenuPopup->SetMenuItemBitmaps(ID_IDR_DEVICE, MF_BYCOMMAND, &m_bitMenuDevice, &m_bitMenuDevice); - - mii.dwTypeData = const_castLANG_STR("IDS_VIDEO_MOREFILTER"); - mii.cch = _tcslen(LANG_STR("IDS_VIDEO_MOREFILTER")) + 1; - pMenuPopup->SetMenuItemInfo(2, &mii, FALSE); - pMenuPopup->SetMenuItemBitmaps(ID_IDR_FILTER, MF_BYCOMMAND, &m_bitMenuFilter, &m_bitMenuFilter); - if (m_bFilter) - nFlag = MF_BYCOMMAND | MF_CHECKED; - else - nFlag = MF_BYCOMMAND | MF_UNCHECKED; - pMenuPopup->CheckMenuItem(ID_IDR_FILTER, nFlag); - - - m_btnMore.GetWindowRect(&rcButton); - - int x = rcButton.left - 60; - int y = rcButton.top - 75; - - pMenuPopup->TrackPopupMenu(TPM_RIGHTBUTTON, x, y, this); - pMenuPopup->DestroyMenu(); -} - -void CVideoDlg::OnBnClickedBtnsetup() -{ - m_dlgDevice.ShowWindow(SW_SHOW); - m_dlgDevice.CenterWindow(); -} - -void CVideoDlg::OnBnClickedBtnfilter() -{ - IRtcEngine *lpEngine = CAgoraObject::GetEngine(); - - if (!m_bFilter){ - load_preprocessing_plugin(lpEngine); - } - else{ - unload_preprocessing_plugin(lpEngine); - } - - m_bFilter = !m_bFilter; -} - -void CVideoDlg::OnBnClickedBtnmessage() -{ - BOOL bIsShowing = m_dlgChat.IsWindowVisible(); - CRect rcChatArea; - - rcChatArea.CopyRect(&m_rcVideoArea); - rcChatArea.top = rcChatArea.bottom - 150; - ClientToScreen(&rcChatArea); - - if (bIsShowing) { - m_dlgChat.ShowWindow(SW_HIDE); - m_btnMessage.SwitchButtonStatus(CAGButton::AGBTN_NORMAL); - } - else { - m_dlgChat.ShowWindow(SW_SHOW); - m_dlgChat.MoveWindow(&rcChatArea, TRUE); - m_btnMessage.SwitchButtonStatus(CAGButton::AGBTN_PUSH); - } -} - -void CVideoDlg::OnBnClickedBtnmode() -{ - CAgoraObject *lpAgora = CAgoraObject::GetAgoraObject(); - IRtcEngine *lpRtcEngine = CAgoraObject::GetEngine(); - - if (!lpAgora->IsLocalVideoMuted()) { - lpAgora->MuteLocalVideo(TRUE); - m_btnMode.SetBackImage(IDB_BTNVIDEO_VIDEO); - - CAgoraObject::GetAgoraObject()->EnableLocalRender(FALSE); - m_wndLocal.SetBackImage(IDB_BACKGROUND_VIDEO, 96, 96); - m_wndLocal.ShowBackground(TRUE); - } - else { - lpAgora->EnableVideo(TRUE); - lpAgora->MuteLocalVideo(FALSE); - CAgoraObject::GetAgoraObject()->EnableLocalRender(TRUE); - m_btnMode.SetBackImage(IDB_BTNAUDIO_VIDEO); - m_wndLocal.ShowBackground(FALSE); - } - - m_wndLocal.Invalidate(TRUE); - m_wndLocal.UpdateWindow(); - - Invalidate(TRUE); - UpdateWindow(); -} - -void CVideoDlg::OnBnClickedBtnaudio() -{ - CAgoraObject *lpAgora = CAgoraObject::GetAgoraObject(); - - if (lpAgora->IsLocalAudioMuted()) { - lpAgora->MuteLocalAudio(FALSE); - m_btnAudio.SwitchButtonStatus(CAGButton::AGBTN_NORMAL); - } - else { - lpAgora->MuteLocalAudio(TRUE); - m_btnAudio.SwitchButtonStatus(CAGButton::AGBTN_PUSH); - } -} - -LRESULT CVideoDlg::OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lParam) -{ - LPAGE_JOINCHANNEL_SUCCESS lpData = (LPAGE_JOINCHANNEL_SUCCESS)wParam; - - m_listWndInfo.RemoveAll(); - CAgoraObject::GetAgoraObject()->SetSelfUID(lpData->uid); - - delete lpData; - return 0; -} - -LRESULT CVideoDlg::OnEIDReJoinChannelSuccess(WPARAM wParam, LPARAM lParam) -{ - LPAGE_REJOINCHANNEL_SUCCESS lpData = (LPAGE_REJOINCHANNEL_SUCCESS)wParam; - - m_listWndInfo.RemoveAll(); - delete lpData; - - return 0; -} - -LRESULT CVideoDlg::OnEIDFirstLocalFrame(WPARAM wParam, LPARAM lParam) -{ - LPAGE_FIRST_LOCAL_VIDEO_FRAME lpData = (LPAGE_FIRST_LOCAL_VIDEO_FRAME)wParam; - - if (m_listWndInfo.GetCount() == 0) - ShowVideo1(); - - delete lpData; - - return 0; -} - -LRESULT CVideoDlg::OnEIDFirstRemoteFrameDecoded(WPARAM wParam, LPARAM lParam) -{ - LPAGE_FIRST_REMOTE_VIDEO_DECODED lpData = (LPAGE_FIRST_REMOTE_VIDEO_DECODED)wParam; - BOOL bFound = FALSE; - - POSITION pos = m_listWndInfo.GetHeadPosition(); - while (pos != NULL) { - AGVIDEO_WNDINFO &agvWndInfo = m_listWndInfo.GetNext(pos); - if (agvWndInfo.nUID == lpData->uid) { - bFound = TRUE; - break; - } - } - - if (!bFound) { - AGVIDEO_WNDINFO agvWndInfo; - memset(&agvWndInfo, 0, sizeof(AGVIDEO_WNDINFO)); - agvWndInfo.nUID = lpData->uid; - agvWndInfo.nWidth = lpData->width; - agvWndInfo.nHeight = lpData->height; - - m_listWndInfo.AddTail(agvWndInfo); - } - - RebindVideoWnd(); - - delete lpData; - - return 0; -} - -LRESULT CVideoDlg::OnEIDUserJoined(WPARAM wParam, LPARAM lParam) -{ - CString str; - LPAGE_USER_JOINED lpData = (LPAGE_USER_JOINED)wParam; - - str.Format(_T("%d joined the channel"), lpData->uid); - MessageBox(str); - return 0; -} - -LRESULT CVideoDlg::OnEIDUserOffline(WPARAM wParam, LPARAM lParam) -{ - LPAGE_USER_OFFLINE lpData = (LPAGE_USER_OFFLINE)wParam; - - POSITION pos = m_listWndInfo.GetHeadPosition(); - while (pos != NULL){ - if (m_listWndInfo.GetAt(pos).nUID == lpData->uid) { - m_listWndInfo.RemoveAt(pos); - RebindVideoWnd(); - break; - } - - m_listWndInfo.GetNext(pos); - } - - delete lpData; - - return 0; -} - -LRESULT CVideoDlg::OnEIDConnectionLost(WPARAM wParam, LPARAM lParam) -{ - return 0; -} - -LRESULT CVideoDlg::OnEIDVideoDeviceChanged(WPARAM wParam, LPARAM lParam) -{ - return 0; -} - -LRESULT CVideoDlg::OnRemoteVideoStat(WPARAM wParam, LPARAM lParam) -{ - LPAGE_REMOTE_VIDEO_STAT lpData = (LPAGE_REMOTE_VIDEO_STAT)wParam; - - POSITION posNext = m_listWndInfo.GetHeadPosition(); - - while (posNext != NULL) { - AGVIDEO_WNDINFO &rWndInfo = m_listWndInfo.GetNext(posNext); - - if (rWndInfo.nUID == lpData->uid) { - rWndInfo.nFramerate = lpData->rendererOutputFrameRate; - rWndInfo.nBitrate = lpData->receivedBitrate; - rWndInfo.nWidth = lpData->width; - rWndInfo.nHeight = lpData->height; - m_wndVideo[rWndInfo.nIndex].SetFrameRateInfo(rWndInfo.nFramerate); - m_wndVideo[rWndInfo.nIndex].SetBitrateInfo(rWndInfo.nBitrate); - m_wndVideo[rWndInfo.nIndex].SetVideoResolution(rWndInfo.nWidth, rWndInfo.nHeight); - break; - } - } - - delete lpData; - - return 0; -} - -LRESULT CVideoDlg::OnStartRecordingService(WPARAM wParam, LPARAM lParam) -{ - - return 0; -} - -LRESULT CVideoDlg::OnStopRecordingService(WPARAM wParam, LPARAM lParam) -{ - return 0; -} - -LRESULT CVideoDlg::OnStreamMessage(WPARAM wParam, LPARAM lParam) -{ - LPAGE_STREAM_MESSAGE lpData = (LPAGE_STREAM_MESSAGE)wParam; - TCHAR szMessage[256]; - - int nUTF8Len = lpData->length; - - memset(szMessage, 0, 256 * sizeof(TCHAR)); -#ifdef UNICODE - ::MultiByteToWideChar(CP_UTF8, 0, lpData->data, lpData->length, szMessage, 256); -#else - _tcscpy_s(szMessage, 256, lpData->data); -#endif - - m_dlgChat.AddChatMessage(lpData->uid, szMessage); - - delete[] lpData->data; - delete lpData; - - return 0; -} - -void CVideoDlg::DrawHead(CDC *pDC) -{ - CRect rcTitle; - CString strTitle; - - if (m_bFullScreen) - return; - - GetWindowText(strTitle); - GetClientRect(&rcTitle); - CBrush *lpDefaultBrush = pDC->SelectObject(&m_brHead); - - rcTitle.bottom = 24; - pDC->FillRect(&rcTitle, &m_brHead); - - pDC->SetBkMode(TRANSPARENT); - pDC->SetTextColor(RGB(0xFF, 0xFF, 0xFF)); - pDC->DrawText(strTitle, &rcTitle, DT_SINGLELINE | DT_VCENTER | DT_CENTER); - pDC->SelectObject(lpDefaultBrush); -} - -void CVideoDlg::InitCtrls() -{ - CRect rcClient; - int nScreenWidth = ::GetSystemMetrics(SM_CXSCREEN); - int nScreenHeight = ::GetSystemMetrics(SM_CYSCREEN); - - GetClientRect(&rcClient); - - m_btnMessage.Create(NULL, WS_VISIBLE | WS_CHILD, CRect(0, 0, 1, 1), this, IDC_BTNMESSAGE_VIDEO); - m_btnMode.Create(NULL, WS_VISIBLE | WS_CHILD, CRect(0, 0, 1, 1), this, IDC_BTNMODE_VIDEO); - m_btnAudio.Create(NULL, WS_VISIBLE | WS_CHILD, CRect(0, 0, 1, 1), this, IDC_BTNAUDIO_VIDEO); - m_btnEndCall.Create(NULL, WS_VISIBLE | WS_CHILD, CRect(0, 0, 1, 1), this, IDC_BTNENDCALL_VIDEO); - m_btnScrCap.Create(NULL, WS_VISIBLE | WS_CHILD, CRect(0, 0, 1, 1), this, IDC_BTNSCRCAP_VIDEO); - m_btnMore.Create(NULL, WS_VISIBLE | WS_CHILD, CRect(0, 0, 1, 1), this, IDC_BTNMORE_VIDEO); - - m_btnShow.Create(NULL, WS_VISIBLE | WS_CHILD, CRect(0, 0, 1, 1), this, IDC_BTNSCR_VIDEO); - - for (int nIndex = 0; nIndex < 4; nIndex++){ - m_wndVideo[nIndex].Create(NULL, NULL, WS_CHILD | WS_VISIBLE | WS_BORDER, CRect(0, 0, 1, 1), this, IDC_BASEWND_VIDEO + nIndex); - m_wndVideo[nIndex].SetBackImage(IDB_BACKGROUND_VIDEO, 96, 96, RGB(0x44, 0x44, 0x44)); - m_wndVideo[nIndex].SetFaceColor(RGB(0x58, 0x58, 0x58)); - } - - m_wndLocal.Create(NULL, NULL, WS_CHILD | WS_VISIBLE | WS_BORDER, CRect(0, 0, 1, 1), this, IDC_BASEWND_VIDEO + 4); - m_wndLocal.SetBackImage(IDB_BACKGROUND_VIDEO, 96, 96, RGB(0x44, 0x44, 0x44)); - m_wndLocal.SetFaceColor(RGB(0x58, 0x58, 0x58)); - m_wndLocal.SetUID(0); - - m_btnMin.MoveWindow(rcClient.Width() - 72, 1, 22, 22, TRUE); - m_btnRst.MoveWindow(rcClient.Width() - 48, 1, 22, 22, TRUE); - m_btnClose.MoveWindow(rcClient.Width() - 24, 1, 22, 22, TRUE); - - m_btnMessage.MoveWindow(rcClient.Width() / 2 - 144, rcClient.Height() - 84, 48, 48, TRUE); - m_btnMode.MoveWindow(rcClient.Width() / 2 - 24, rcClient.Height() - 84, 48, 48, TRUE); - m_btnAudio.MoveWindow(rcClient.Width() / 2 + 24, rcClient.Height() - 84, 48, 48, TRUE); - m_btnShow.MoveWindow(rcClient.Width() - 72, rcClient.Height() - 84, 48, 48, TRUE); - m_btnMore.MoveWindow(rcClient.Width() / 2 + 264, rcClient.Height() - 84, 48, 48, TRUE); - m_btnEndCall.MoveWindow(rcClient.Width() - 120, rcClient.Height() - 84, 48, 48, TRUE); - - m_wndVideo[0].MoveWindow(0, 24, rcClient.Width(), rcClient.Height() - 96, TRUE); - - m_btnMin.SetBackImage(IDB_BTNMIN, RGB(0xFF, 0x00, 0xFF)); - m_btnRst.SetBackImage(IDB_BTNMAX, RGB(0xFF, 0x00, 0xFF)); - m_btnClose.SetBackImage(IDB_BTNCLOSE, RGB(0xFF, 0x00, 0xFF)); - - m_btnScrCap.SetBackColor(RGB(0x26, 0x26, 0x26), RGB(0x26, 0x26, 0x26), RGB(0x26, 0x26, 0x26), RGB(0x26, 0x26, 0x26)); - m_btnScrCap.EnableFrameEffect(FALSE); - m_btnScrCap.SetBackImage(IDB_BTNSCRCAP_VIDEO, RGB(0x26, 0x26, 0x26)); - - m_btnMessage.SetBackColor(RGB(0x26, 0x26, 0x26), RGB(0x26, 0x26, 0x26), RGB(0x26, 0x26, 0x26), RGB(0x26, 0x26, 0x26)); - m_btnMessage.EnableFrameEffect(FALSE); - m_btnMessage.SetBackImage(IDB_BTNMSG_VIDEO, RGB(0x26, 0x26, 0x26)); - - m_btnMode.SetBackColor(RGB(0x26, 0x26, 0x26), RGB(0x26, 0x26, 0x26), RGB(0x26, 0x26, 0x26), RGB(0x26, 0x26, 0x26)); - m_btnMode.EnableFrameEffect(FALSE); - m_btnMode.SetBackImage(IDB_BTNAUDIO_VIDEO, RGB(0x26, 0x26, 0x26)); - - m_btnAudio.SetBackColor(RGB(0x26, 0x26, 0x26), RGB(0x26, 0x26, 0x26), RGB(0x26, 0x26, 0x26), RGB(0x26, 0x26, 0x26)); - m_btnAudio.EnableFrameEffect(FALSE); - m_btnAudio.SetBackImage(IDB_BTNMAUDIO_VIDEO, RGB(0x26, 0x26, 0x26)); - - m_btnShow.SetBackColor(RGB(0x26, 0x26, 0x26), RGB(0x26, 0x26, 0x26), RGB(0x26, 0x26, 0x26), RGB(0x26, 0x26, 0x26)); - m_btnShow.EnableFrameEffect(FALSE); - m_btnShow.SetBackImage(IDB_BTNFULLSCR_VIDEO, RGB(0x26, 0x26, 0x26)); - - m_btnEndCall.SetBackColor(RGB(0x26, 0x26, 0x26), RGB(0x26, 0x26, 0x26), RGB(0x26, 0x26, 0x26), RGB(0x26, 0x26, 0x26)); - m_btnEndCall.EnableFrameEffect(FALSE); - m_btnEndCall.SetBackImage(IDB_BTNENDCALL_VIDEO, RGB(0x26, 0x26, 0x26)); - - m_btnMore.SetBackColor(RGB(0x26, 0x26, 0x26), RGB(0x26, 0x26, 0x26), RGB(0x26, 0x26, 0x26), RGB(0x26, 0x26, 0x26)); - m_btnMore.EnableFrameEffect(FALSE); - m_btnMore.SetBackImage(IDB_BTNMORE_VIDEO, RGB(0x26, 0x26, 0x26)); -} - -void CVideoDlg::ShowVideo1() -{ - m_wndLocal.ShowWindow(SW_HIDE); - m_wndLocal.SetBigShowFlag(FALSE); - for (int nIndex = 0; nIndex < 4; nIndex++) { - m_wndVideo[nIndex].ShowWindow(SW_HIDE); - m_wndVideo[nIndex].SetBigShowFlag(FALSE); - } - - if (m_listWndInfo.GetCount() == 0) { - m_wndLocal.MoveWindow(&m_rcVideoArea, FALSE); - m_wndLocal.SetParent(this); - m_wndLocal.SetBigShowFlag(TRUE); - m_wndLocal.ShowWindow(SW_SHOW); - } - else { - m_wndVideo[0].MoveWindow(&m_rcVideoArea, FALSE); - m_wndVideo[0].ShowWindow(SW_SHOW); - m_wndVideo[0].SetBigShowFlag(TRUE); - m_wndVideo[0].SetParent(this); - - m_wndLocal.MoveWindow(&m_rcChildVideoArea, FALSE); - m_wndLocal.SetParent(&m_wndVideo[0]); - m_wndLocal.ShowWindow(SW_SHOW); - m_wndLocal.SetParent(&m_wndVideo[0]); - } - - m_nScreenMode = SCREEN_VIDEO1; - - ShowButtonsNormal(); -} - -void CVideoDlg::ShowVideo4() -{ - m_wndLocal.ShowWindow(SW_HIDE); - m_wndLocal.SetBigShowFlag(FALSE); - for (int nIndex = 0; nIndex < 4; nIndex++) { - m_wndVideo[nIndex].ShowWindow(SW_SHOW); - m_wndVideo[nIndex].SetBigShowFlag(FALSE); - m_wndVideo[nIndex].SetParent(this); - } - - m_wndVideo[0].MoveWindow(0, m_rcVideoArea.top, m_rcVideoArea.Width() / 2, m_rcVideoArea.Height() / 2, FALSE); - m_wndVideo[1].MoveWindow(m_rcVideoArea.Width() / 2, m_rcVideoArea.top, m_rcVideoArea.Width() / 2, m_rcVideoArea.Height() / 2, FALSE); - m_wndVideo[2].MoveWindow(0, m_rcVideoArea.top + m_rcVideoArea.Height() / 2, m_rcVideoArea.Width() / 2, m_rcVideoArea.Height() / 2, FALSE); - m_wndVideo[3].MoveWindow(m_rcVideoArea.Width() / 2, m_rcVideoArea.top + m_rcVideoArea.Height() / 2, m_rcVideoArea.Width() / 2, m_rcVideoArea.Height() / 2, FALSE); - - CRect rcLocal; - int nRemoteCount = m_listWndInfo.GetCount(); - - if (nRemoteCount == 2) - m_wndLocal.MoveWindow(0, m_rcVideoArea.top + m_rcVideoArea.Height() / 2, m_rcVideoArea.Width() / 2, m_rcVideoArea.Height() / 2, FALSE); - else - m_wndLocal.MoveWindow(m_rcVideoArea.Width() / 2, m_rcVideoArea.top + m_rcVideoArea.Height() / 2, m_rcVideoArea.Width() / 2, m_rcVideoArea.Height() / 2, FALSE); - - m_wndVideo[nRemoteCount].ShowWindow(SW_HIDE); - m_wndLocal.SetParent(this); - m_wndLocal.ShowWindow(SW_SHOW); - - m_nScreenMode = SCREEN_VIDEO4; - - ShowButtonsNormal(); - -} - -void CVideoDlg::ShowMulti() -{ - int nLocalIndex = 0; - - m_wndLocal.ShowWindow(TRUE); - m_wndLocal.SetBigShowFlag(FALSE); - for (int nIndex = 0; nIndex < 4; nIndex++) { - m_wndVideo[nIndex].ShowWindow(SW_HIDE); - m_wndVideo[nIndex].SetBigShowFlag(FALSE); - } - - if (m_lpBigShowed == NULL) - m_lpBigShowed = &m_wndVideo[0]; - - m_lpBigShowed->ShowWindow(SW_SHOW); - m_lpBigShowed->MoveWindow(&m_rcVideoArea, TRUE); - m_lpBigShowed->SetParent(this); - m_lpBigShowed->SetBigShowFlag(TRUE); - - for (int nIndex = 0; nIndex < 4; nIndex++) { - int nXPos = (m_rcVideoArea.Width() / 2) - 402 + (204 * nLocalIndex); - int nYPos = m_rcVideoArea.top + 16; - - if (!m_wndVideo[nIndex].IsBigShow()) { - if (m_wndVideo[nIndex].GetUID() != 0) { - m_wndVideo[nIndex].MoveWindow(nXPos, nYPos, 192, 144, TRUE); - m_wndVideo[nIndex].ShowWindow(SW_SHOW); - m_wndVideo[nIndex].SetParent(m_lpBigShowed); - nLocalIndex++; - } - } - else{ - m_wndLocal.MoveWindow(nXPos, nYPos, 192, 144, TRUE); - m_wndLocal.ShowWindow(SW_SHOW); - m_wndLocal.SetParent(m_lpBigShowed); - nLocalIndex++; - } - } - - m_nScreenMode = SCREEN_VIDEOMULTI; - - ShowButtonsNormal(); -} - -BOOL CVideoDlg::OnInitDialog() -{ - CDialogEx::OnInitDialog(); - - m_dlgDevice.Create(CDeviceDlg::IDD, this); - m_dlgDevice.EnableDeviceTest(FALSE); - - m_dlgScreenCapture.Create(CAGScreenCaptureDlg::IDD, this); - m_dlgDesktopCapture.Create(CAGDesktopCaptureDlg::IDD, this); - m_dlgChat.Create(CChatDlg::IDD, this); - InitCtrls(); - - m_bitMenuInfo.LoadBitmap(IDB_MENU_INFO); - m_bitMenuDevice.LoadBitmap(IDB_MENU_DEVICE); - m_bitMenuFilter.LoadBitmap(IDB_MENU_FILTER); - - return TRUE; // return TRUE unless you set the focus to a control -} - - -HWND CVideoDlg::GetRemoteVideoWnd(int nIndex) -{ - if (nIndex < 0 || nIndex > 3) - return NULL; - - return m_wndVideo[nIndex].GetSafeHwnd(); -} - - -void CVideoDlg::RebindVideoWnd() -{ - if (m_wndVideo[0].GetSafeHwnd() == NULL || m_wndLocal.GetSafeHwnd() == NULL) - return; - - VideoCanvas canvas; - - canvas.renderMode = RENDER_MODE_FIT; - - POSITION pos = m_listWndInfo.GetHeadPosition(); - for (int nIndex = 0; nIndex < 4; nIndex++) { - if (pos != NULL) { - AGVIDEO_WNDINFO &agvWndInfo = m_listWndInfo.GetNext(pos); - canvas.uid = agvWndInfo.nUID; - canvas.view = m_wndVideo[nIndex].GetSafeHwnd(); - agvWndInfo.nIndex = nIndex; - - CAgoraObject::GetEngine()->setupRemoteVideo(canvas); - m_wndVideo[nIndex].SetUID(canvas.uid); - m_wndVideo[nIndex].SetVideoResolution(agvWndInfo.nWidth, agvWndInfo.nHeight); - m_wndVideo[nIndex].SetFrameRateInfo(agvWndInfo.nFramerate); - m_wndVideo[nIndex].SetBitrateInfo(agvWndInfo.nBitrate); - } - else - m_wndVideo[nIndex].SetUID(0); - } - - if (m_nScreenMode != SCREEN_VIDEOMULTI) { - if (m_listWndInfo.GetCount() <= 1) - ShowVideo1(); - else if (m_listWndInfo.GetCount() > 1 && m_listWndInfo.GetCount() < 4) - ShowVideo4(); - else - ShowMulti(); - } - else - ShowMulti(); -} - -BOOL CVideoDlg::PreTranslateMessage(MSG* pMsg) -{ - if (pMsg->message == WM_KEYDOWN){ - switch (pMsg->wParam){ - case VK_RETURN: - return FALSE; - case VK_ESCAPE: - if (m_bFullScreen) - OnBnClickedBtnfullscr(); - - return FALSE; - } - } - - return CDialogEx::PreTranslateMessage(pMsg); -} - -LRESULT CVideoDlg::OnShowModeChanged(WPARAM wParam, LPARAM lParam) -{ - if (m_nScreenMode == SCREEN_VIDEOMULTI) { - if (m_listWndInfo.GetCount() <= 1) - ShowVideo1(); - else if (m_listWndInfo.GetCount() > 1 && m_listWndInfo.GetCount() < 4) - ShowVideo4(); - } - else { - m_lpBigShowed = (CAGVideoWnd *)wParam; - ShowMulti(); - } - - return 0; -} - -LRESULT CVideoDlg::OnShowBig(WPARAM wParam, LPARAM lParam) -{ - CRect rcNextBig; - CRect rcCurBig; - - if (m_nScreenMode != SCREEN_VIDEOMULTI) - return 0; - - CAGVideoWnd *lpNextBigWnd = (CAGVideoWnd *)wParam; - if (lpNextBigWnd == m_lpBigShowed) - return 0; - - ShowMulti(); - m_lpBigShowed = lpNextBigWnd; - - return 0; -} - -LRESULT CVideoDlg::OnWindowShareStart(WPARAM wParam, LPARAM lParam) -{ - HWND hShareWnd = (HWND)wParam; - if (hShareWnd == GetSafeHwnd()) { - CAgoraObject::GetAgoraObject()->EnableLocalRender(FALSE); - m_wndLocal.Invalidate(TRUE); - } - - CAgoraObject::GetAgoraObject()->EnableScreenCapture((HWND)wParam, 15, NULL, TRUE); - m_btnScrCap.SwitchButtonStatus(CAGButton::AGBTN_PUSH); - - return 0; -} - -LRESULT CVideoDlg::OnDesktopShareStart(WPARAM wParam, LPARAM lParam) -{ - LPDESKTOP_SHARE_PARAM lpDesktopShareParam = (LPDESKTOP_SHARE_PARAM)(wParam); - CRect rcRegion; - - CAgoraObject::GetAgoraObject()->EnableVideo(); - - rcRegion.left = lpDesktopShareParam->nX; - rcRegion.top = lpDesktopShareParam->nY; - rcRegion.right = rcRegion.left + lpDesktopShareParam->nWidth; - rcRegion.bottom = rcRegion.top + lpDesktopShareParam->nHeight; - - CAgoraObject::GetAgoraObject()->EnableScreenCapture(NULL, lpDesktopShareParam->nFPS, &rcRegion, TRUE); - // Sleep(1000); - // CAgoraObject::GetAgoraObject()->SetVideoProfileEx(lpDesktopShareParam->nWidth, lpDesktopShareParam->nHeight, lpDesktopShareParam->nFPS, lpDesktopShareParam->nBitrate); - - m_btnScrCap.SwitchButtonStatus(CAGButton::AGBTN_PUSH); - - return 0; -} - -void CVideoDlg::OnShowWindow(BOOL bShow, UINT nStatus) -{ - CDialogEx::OnShowWindow(bShow, nStatus); - - if (bShow && GetSafeHwnd() != NULL) - RebindVideoWnd(); -} - - -void CVideoDlg::OnMove(int x, int y) -{ - CDialogEx::OnMove(x, y); - - CRect rcChatBox; - - rcChatBox.SetRect(x, y + m_rcVideoArea.Height() - 126, x + m_rcVideoArea.Width(), y + m_rcVideoArea.Height() + 24); - - if (::IsWindow(m_dlgChat.GetSafeHwnd()) && m_dlgChat.IsWindowVisible()){ - m_dlgChat.MoveWindow(&rcChatBox); - } -} diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/VideoDlg.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/VideoDlg.h deleted file mode 100644 index ccf65a27..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/VideoDlg.h +++ /dev/null @@ -1,180 +0,0 @@ -#pragma once -#include "AGButton.h" -#include "AGVideoWnd.h" -#include "DeviceDlg.h" -#include "AGScreenCaptureDlg.h" -#include "AGDesktopCaptureDlg.h" -#include "ChatDlg.h" - -// CVideoDlg Ի - -class CVideoDlg : public CDialogEx -{ - DECLARE_DYNAMIC(CVideoDlg) - -public: - CVideoDlg(CWnd* pParent = NULL); // ׼캯 - virtual ~CVideoDlg(); - -// Ի - enum { IDD = IDD_VIDEO_DIALOG }; - - enum { - SCREEN_VIDEO1 = 0, // - SCREEN_VIDEO4, // 4 - SCREEN_VIDEOMULTI, // 14С -// SCREEN_WHITEBOARD // װ - }; - -// enum { -// WHITEBOARD_HOST = 0, -// WHITEBOARD_GUEST -// }; - - HWND GetRemoteVideoWnd(int nIndex); - HWND GetLocalVideoWnd() { return m_wndLocal.GetSafeHwnd(); }; - - void RebindVideoWnd(); - - void ShowControlButton(BOOL bShow = TRUE); - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ - virtual BOOL OnInitDialog(); - virtual BOOL PreTranslateMessage(MSG* pMsg); - - afx_msg void OnMouseMove(UINT nFlags, CPoint point); - afx_msg void OnSize(UINT nType, int cx, int cy); - afx_msg void OnPaint(); - afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); - afx_msg void OnMove(int x, int y); - - afx_msg LRESULT OnNcHitTest(CPoint point); - afx_msg LRESULT OnShowModeChanged(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnShowBig(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnWindowShareStart(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnDesktopShareStart(WPARAM wParam, LPARAM lParam); - - afx_msg void OnBnClickedBtnmin(); - afx_msg void OnBnClickedBtnclose(); - afx_msg void OnBnClickedBtnrest(); - - afx_msg void OnBnClickedBtnmessage(); - afx_msg void OnBnClickedBtnmode(); - afx_msg void OnBnClickedBtnaudio(); - afx_msg void OnBnClickedBtnScreenCapture(); - afx_msg void OnBnCliekedBtnWhiteBoard(); - afx_msg void OnBnCliekedBtnCloseWhiteBoard(); - afx_msg void OnBnClickedBtnMore(); - - afx_msg void OnBnClickedBtntip(); - afx_msg void OnBnClickedBtnsetup(); - afx_msg void OnBnClickedBtnfilter(); - - afx_msg void OnBnClickedBtnfullscr(); - - afx_msg void OnBnClickedScreenshare(); - afx_msg void OnBnClickedWindowshare(); - - afx_msg void OnBnClickedHostMode(); - afx_msg void OnBnClickedGuestMode(); - // ڴĻصϢ - afx_msg LRESULT OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnEIDReJoinChannelSuccess(WPARAM wParam, LPARAM lParam); - - afx_msg LRESULT OnEIDFirstLocalFrame(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnEIDFirstRemoteFrameDecoded(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnEIDUserJoined(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnEIDUserOffline(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnEIDConnectionLost(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnEIDVideoDeviceChanged(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnRemoteVideoStat(WPARAM wParam, LPARAM lParam); - - afx_msg LRESULT OnStartRecordingService(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnStopRecordingService(WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnApiCallExecuted(WPARAM wParam, LPARAM lParam); - - afx_msg LRESULT OnStreamMessage(WPARAM wParam, LPARAM lParam); - - DECLARE_MESSAGE_MAP() - -protected: - BOOL NeedShowSizeBox(CPoint point); - void EnableSize(BOOL bEnable); - void CreateScreenShareMenu(); - void CreateMoreMenu(); - - void DrawHead(CDC *pDC); - - void InitCtrls(); - - void ShowVideo1(); - void ShowVideo4(); - void ShowMulti(); - - void ShowButtonsNormal(); - - void AdjustButtonsNormal(int cx, int cy); - void AdjustSizeVideo1(int cx, int cy); - void AdjustSizeVideo4(int cx, int cy); - void AdjustSizeVideoMulti(int cx, int cy); - -private: - CBrush m_brHead; - - CAGButton m_btnMin; - CAGButton m_btnRst; - CAGButton m_btnClose; - - CAGButton m_btnMessage; - CAGButton m_btnMode; - CAGButton m_btnAudio; - CAGButton m_btnEndCall; - CAGButton m_btnScrCap; - CAGButton m_btnMore; - - CAGButton m_btnShow; - - BOOL m_bLastStat; - UINT m_nScreenMode; - UINT m_nBigShowedUID; - - CAGVideoWnd m_wndLocal; - CAGVideoWnd m_wndVideo[4]; - CAGVideoWnd *m_lpBigShowed; - - CDeviceDlg m_dlgDevice; - CChatDlg m_dlgChat; - - CAGScreenCaptureDlg m_dlgScreenCapture; - CAGDesktopCaptureDlg m_dlgDesktopCapture; - - CRect m_rcVideoArea; - CRect m_rcChildVideoArea; - - CBitmap m_bitMenuInfo; - CBitmap m_bitMenuDevice; - CBitmap m_bitMenuFilter; - -private: // data - - typedef struct _AGVIDEO_WNDINFO - { - UINT nUID; - int nIndex; - - UINT nWidth; - UINT nHeight; - int nBitrate; - int nFramerate; - int nCodec; - - } AGVIDEO_WNDINFO, *PAGVIDEO_WNDINFO, *LPAGVIDEO_WNDINFO; - - CList m_listWndInfo; - - BOOL m_bRecording; - BOOL m_bFullScreen; - BOOL m_bFilter; - BOOL m_bShowInfo; -}; diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BACKGROUND_VIDEO.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BACKGROUND_VIDEO.bmp deleted file mode 100644 index b4b583b7..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BACKGROUND_VIDEO.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNAUDIO_VIDEO.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNAUDIO_VIDEO.bmp deleted file mode 100644 index bcf55f4b..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNAUDIO_VIDEO.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNCLOSE.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNCLOSE.bmp deleted file mode 100644 index bc90a774..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNCLOSE.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNENDCALL_VIDEO.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNENDCALL_VIDEO.bmp deleted file mode 100644 index 73f41f19..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNENDCALL_VIDEO.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNFULLSCR_VIDEO.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNFULLSCR_VIDEO.bmp deleted file mode 100644 index d78bbeea..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNFULLSCR_VIDEO.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNMAUDIO_VIDEO.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNMAUDIO_VIDEO.bmp deleted file mode 100644 index 530f73a3..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNMAUDIO_VIDEO.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNMAX.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNMAX.bmp deleted file mode 100644 index 67d9c69f..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNMAX.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNMIN.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNMIN.bmp deleted file mode 100644 index 75ec49c8..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNMIN.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNMORE_VIDEO.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNMORE_VIDEO.bmp deleted file mode 100644 index 3d66409d..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNMORE_VIDEO.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNMSG_VIDEO.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNMSG_VIDEO.bmp deleted file mode 100644 index 7da4eb10..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNMSG_VIDEO.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNNORSCR_VIDEO.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNNORSCR_VIDEO.bmp deleted file mode 100644 index 6e043f87..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNNORSCR_VIDEO.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNRESTORE.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNRESTORE.bmp deleted file mode 100644 index cd1ef0e2..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNRESTORE.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNSCRCAP_VIDEO.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNSCRCAP_VIDEO.bmp deleted file mode 100644 index e217776f..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNSCRCAP_VIDEO.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNSETUP_VIDEO.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNSETUP_VIDEO.bmp deleted file mode 100644 index 557d3a51..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNSETUP_VIDEO.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNTIP_VIDEO.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNTIP_VIDEO.bmp deleted file mode 100644 index fd7da2ef..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNTIP_VIDEO.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNVIDEO_VIDEO.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNVIDEO_VIDEO.bmp deleted file mode 100644 index 78e34258..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_BTNVIDEO_VIDEO.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_CMBBTN.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_CMBBTN.bmp deleted file mode 100644 index f47646e7..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_CMBBTN.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_CMBSEL.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_CMBSEL.bmp deleted file mode 100644 index 9cccaffd..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_CMBSEL.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_DESKTOPSHARE_VIDEO.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_DESKTOPSHARE_VIDEO.bmp deleted file mode 100644 index 37646f08..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_DESKTOPSHARE_VIDEO.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_DLG_LOGO.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_DLG_LOGO.bmp deleted file mode 100644 index 12271e53..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_DLG_LOGO.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_DLG_MAIN.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_DLG_MAIN.bmp deleted file mode 100644 index 3f873f1e..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_DLG_MAIN.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_LOGO.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_LOGO.bmp deleted file mode 100644 index 96cb2128..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_LOGO.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_MENU_DEVICE.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_MENU_DEVICE.bmp deleted file mode 100644 index 003c466f..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_MENU_DEVICE.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_MENU_FILTER.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_MENU_FILTER.bmp deleted file mode 100644 index 34b3d1d7..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_MENU_FILTER.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_MENU_INFO.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_MENU_INFO.bmp deleted file mode 100644 index fe7cbf38..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_MENU_INFO.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_MENU_MORE.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_MENU_MORE.bmp deleted file mode 100644 index 7ce697a2..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_MENU_MORE.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_NETWORK_QUALITY.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_NETWORK_QUALITY.bmp deleted file mode 100644 index 1e2c8395..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_NETWORK_QUALITY.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_SLD_HOVER.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_SLD_HOVER.bmp deleted file mode 100644 index c6d601a5..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_SLD_HOVER.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_SLD_NORMAL.bmp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_SLD_NORMAL.bmp deleted file mode 100644 index 23ec5c94..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/IDB_SLD_NORMAL.bmp and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/ID_TEST_AUDIO.wav b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/ID_TEST_AUDIO.wav deleted file mode 100644 index 196920cd..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/ID_TEST_AUDIO.wav and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/OpenVideoCall.ico b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/OpenVideoCall.ico deleted file mode 100644 index 0ac6e0fd..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/OpenVideoCall.ico and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/OpenVideoCall.rc2 b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/OpenVideoCall.rc2 deleted file mode 100644 index 973023e8..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/res/OpenVideoCall.rc2 and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/resource.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/resource.h deleted file mode 100644 index adddab1e..00000000 Binary files a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/resource.h and /dev/null differ diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/stdafx.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/stdafx.cpp deleted file mode 100644 index c7a9377f..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/stdafx.cpp +++ /dev/null @@ -1,8 +0,0 @@ - -// stdafx.cpp : source file that includes just the standard includes -// AgoraVideoCall.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - - diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/stdafx.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/stdafx.h deleted file mode 100644 index d3db1e6a..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/stdafx.h +++ /dev/null @@ -1,59 +0,0 @@ - -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, -// but are changed infrequently - -#pragma once - -#ifndef VC_EXTRALEAN -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers -#endif - -#include "targetver.h" - -#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit - -// turns off MFC's hiding of some common and often safely ignored warning messages -#define _AFX_ALL_WARNINGS - -#include // MFC core and standard components -#include // MFC extensions - - -#include // MFC Automation classes - - - -#ifndef _AFX_NO_OLE_SUPPORT -#include // MFC support for Internet Explorer 4 Common Controls -#endif -#ifndef _AFX_NO_AFXCMN_SUPPORT -#include // MFC support for Windows Common Controls -#endif // _AFX_NO_AFXCMN_SUPPORT - -#include // MFC support for ribbons and control bars - -#include "LanguageSet.h" -#include "AGMessage.h" - -#include -#include -#include "AgoraObject.h" -#include "AGEventDef.h" -#include -#include - -#pragma comment(lib, "agora_rtc_sdk.lib") - - -#ifdef _UNICODE -#if defined _M_IX86 -#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") -#elif defined _M_X64 -#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") -#else -#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") -#endif -#endif - - diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/targetver.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/targetver.h deleted file mode 100644 index 87c0086d..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/targetver.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -// Including SDKDDKVer.h defines the highest available Windows platform. - -// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and -// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. - -#include diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/video_preprocessing_plugin.cpp b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/video_preprocessing_plugin.cpp deleted file mode 100644 index 94abcb42..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/video_preprocessing_plugin.cpp +++ /dev/null @@ -1,94 +0,0 @@ -#include "stdafx.h" -#include -#include -#include - -static void LogMessage(char *msg) -{ - OutputDebugStringA(msg); -} - -class AgoraAudioFrameObserver : public agora::media::IAudioFrameObserver -{ -public: - virtual bool onRecordAudioFrame(AudioFrame& audioFrame) override - { - char msg[256]; - sprintf_s(msg, 256, "%s: samples=%d, channel=%d, fs=%d\n", __FUNCTION__, audioFrame.samples, audioFrame.channels, audioFrame.samplesPerSec); - LogMessage(msg); - return true; - } - virtual bool onPlaybackAudioFrame(AudioFrame& audioFrame) override - { - char msg[256]; - sprintf_s(msg, "%s: samples=%d, channel=%d, fs=%d\n", __FUNCTION__, audioFrame.samples, audioFrame.channels, audioFrame.samplesPerSec); - LogMessage(msg); - return true; - } - virtual bool onMixedAudioFrame(AudioFrame& audioFrame) - { - char msg[256]; - sprintf_s(msg, "%s: samples=%d, channel=%d, fs=%d\n", __FUNCTION__, audioFrame.samples, audioFrame.channels, audioFrame.samplesPerSec); - LogMessage(msg); - return true; - } - virtual bool onPlaybackAudioFrameBeforeMixing(unsigned int uid, AudioFrame& audioFrame) override - { - char msg[256]; - sprintf_s(msg, "%s: uid=%u, samples=%d, channel=%d, fs=%d\n", __FUNCTION__, uid, audioFrame.samples, audioFrame.channels, audioFrame.samplesPerSec); - LogMessage(msg); - return true; - } -}; - -class AgoraVideoFrameObserver : public agora::media::IVideoFrameObserver -{ -public: - virtual bool onCaptureVideoFrame(VideoFrame& videoFrame) override - { - char msg[256]; - sprintf_s(msg, 256, "%s: width=%d, height=%d\n", __FUNCTION__, videoFrame.width, videoFrame.height); - LogMessage(msg); - - int width = videoFrame.width; - int height = videoFrame.height; - - memset(videoFrame.uBuffer, 128, videoFrame.uStride*height / 2); - memset(videoFrame.vBuffer, 128, videoFrame.vStride*height / 2); - return true; - } - virtual bool onRenderVideoFrame(unsigned int uid, VideoFrame& videoFrame) override - { - char msg[256]; - sprintf_s(msg, 256, "%s: uid=%u, width=%d, height=%d\n", __FUNCTION__, uid, videoFrame.width, videoFrame.height); - LogMessage(msg); - return true; - } -}; - -static AgoraAudioFrameObserver s_audioFrameObserver; -static AgoraVideoFrameObserver s_videoFrameObserver; - -int load_preprocessing_plugin(agora::rtc::IRtcEngine* engine) -{ - agora::util::AutoPtr mediaEngine; - mediaEngine.queryInterface(engine, agora::AGORA_IID_MEDIA_ENGINE); - if (mediaEngine) - { - mediaEngine->registerAudioFrameObserver(&s_audioFrameObserver); - mediaEngine->registerVideoFrameObserver(&s_videoFrameObserver); - } - return 0; -} - -int unload_preprocessing_plugin(agora::rtc::IRtcEngine* engine) -{ - agora::util::AutoPtr mediaEngine; - mediaEngine.queryInterface(engine, agora::AGORA_IID_MEDIA_ENGINE); - if (mediaEngine) - { - mediaEngine->registerAudioFrameObserver(NULL); - mediaEngine->registerVideoFrameObserver(NULL); - } - return 0; -} diff --git a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/video_preprocessing_plugin.h b/Group-Video/OpenVideoCall-Windows/OpenVideoCall/video_preprocessing_plugin.h deleted file mode 100644 index 303816d9..00000000 --- a/Group-Video/OpenVideoCall-Windows/OpenVideoCall/video_preprocessing_plugin.h +++ /dev/null @@ -1,10 +0,0 @@ - -#ifndef _VIDEO_PREPROCESSING_PLUGIN_H_ -#define _VIDEO_PREPROCESSING_PLUGIN_H_ - -#include - -int load_preprocessing_plugin(agora::rtc::IRtcEngine* engine); -int unload_preprocessing_plugin(agora::rtc::IRtcEngine* engine); - -#endif //_VIDEO_PREPROCESSING_PLUGIN_H_ diff --git a/Group-Video/OpenVideoCall-Windows/README.md b/Group-Video/OpenVideoCall-Windows/README.md index 60eb5336..5329957b 100644 --- a/Group-Video/OpenVideoCall-Windows/README.md +++ b/Group-Video/OpenVideoCall-Windows/README.md @@ -65,13 +65,9 @@ please select the OpenVideoCall project in the Solution Explorer and right click Tips: The relevant dll library has been configured for you in this case tutorial. If you want to use the interface provided by agora for related development, you need to put the dll library into the corresponding execution path as prompted above. ## Resources -- For potential issues, you may take a look at our [FAQ](https://docs.agora.io/en/faq) first -- Dive into [Agora SDK Samples](https://github.com/AgoraIO) to see more tutorials -- Would like to see how Agora SDK is used in more complicated real use case? Take a look at [Agora Use Case](https://github.com/AgoraIO-usecase) -- Repositories managed by developer communities can be found at [Agora Community](https://github.com/AgoraIO-Community) + - You can find full API document at [Document Center](https://docs.agora.io/en/) -- If you encounter problems during integration, you can ask question in [Developer Forum](https://stackoverflow.com/questions/tagged/agora.io/) -- You can file bugs about this sample at [issue](https://github.com/AgoraIO/Basic-Video-Call/issues) +- You can file bugs about this demo at [issue](https://github.com/AgoraIO/Basic-Video-Call/issues) ## License diff --git a/Group-Video/OpenVideoCall-Windows/README.zh.md b/Group-Video/OpenVideoCall-Windows/README.zh.md index 64b6c13a..47a23eae 100644 --- a/Group-Video/OpenVideoCall-Windows/README.zh.md +++ b/Group-Video/OpenVideoCall-Windows/README.zh.md @@ -63,13 +63,11 @@ Agora 视频 SDK 支持 iOS / Android / Windows / macOS 等多个平台,你可 ## 联系我们 -- 如果你遇到了困难,可以先参阅[常见问题](https://docs.agora.io/cn/faq) -- 如果你想了解更多官方示例,可以参考[官方SDK示例](https://github.com/AgoraIO) -- 如果你想了解声网SDK在复杂场景下的应用,可以参考[官方场景案例](https://github.com/AgoraIO-usecase) -- 如果你想了解声网的一些社区开发者维护的项目,可以查看[社区](https://github.com/AgoraIO-Community) - 完整的 API 文档见 [文档中心](https://docs.agora.io/cn/) -- 若遇到问题需要开发者帮助,你可以到 [开发者社区](https://rtcdeveloper.com/) 提问 -- 如果发现了示例代码的 bug,欢迎提交 [issue](https://github.com/AgoraIO/Basic-Video-Call/issues) +- 如果在集成中遇到问题, 你可以到 [开发者社区](https://dev.agora.io/cn/) 提问 +- 如果有售前咨询问题, 可以拨打 400 632 6626,或加入官方Q群 12742516 提问 +- 如果需要售后技术支持, 你可以在 [Agora Dashboard](https://dashboard.agora.io) 提交工单 +- 如果发现了示例代码的 bug, 欢迎提交 [issue](https://github.com/AgoraIO/Basic-Video-Call/issues) ## 代码许可 diff --git a/Group-Video/OpenVideoCall-Windows/agoraconfig.cpp b/Group-Video/OpenVideoCall-Windows/agoraconfig.cpp new file mode 100644 index 00000000..309677a3 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/agoraconfig.cpp @@ -0,0 +1,97 @@ +#include "agoraconfig.h" + +CAgoraConfig::CAgoraConfig() +{ + m_spConfig = std::make_shared("AgoraConfigOpenVideoCall.ini",QSettings::IniFormat); +} + +void CAgoraConfig::setAppId(const QString &str) +{ + return m_spConfig->setValue("/BaseInfo/AppId",str); +} + +QString CAgoraConfig::getAppId() +{ + return m_spConfig->value("/BaseInfo/AppId").toString(); +} + +void CAgoraConfig::setChannelName(const QString &str) +{ + return m_spConfig->setValue("/BaseInfo/CameraName",str); +} + +QString CAgoraConfig::getChannelName() +{ + return m_spConfig->value("/BaseInfo/ChannelName").toString(); +} + +void CAgoraConfig::setEnableVideo(bool bEnable) +{ + return m_spConfig->setValue("/BaseInfo/EnableVideo",bEnable); +} + +bool CAgoraConfig::getEnableVideo() +{ + return m_spConfig->value("/BaseInfo/EnableVideo").toBool(); +} + +void CAgoraConfig::setEnableAudio(bool bEnable) +{ + return m_spConfig->setValue("/BaseInfo/EnableAudio",bEnable); +} + +bool CAgoraConfig::getEnableAudio() +{ + return m_spConfig->value("/BaseInfo/EnableAudio").toBool(); +} + + +void CAgoraConfig::setEnableBeauty(bool bEnable) +{ + return m_spConfig->setValue("/BaseInfo/EnableBeauty", bEnable); +} + +bool CAgoraConfig::getEnableBeauty() +{ + return m_spConfig->value("/BaseInfo/EnableBeauty").toBool(); +} + +void CAgoraConfig::setLigtheningContrastLevel(int level) +{ + return m_spConfig->setValue("/Beauty/LightengingContrastLevel", level); +} + +int CAgoraConfig::getLigtheningContrastLevel() +{ + return m_spConfig->value("/Beauty/LightengingContrastLevel").toInt(); +} + +void CAgoraConfig::setRedness(int level) +{ + return m_spConfig->setValue("/Beauty/Redness", level); +} + +int CAgoraConfig::getRedness() +{ + return m_spConfig->value("/Beauty/Redness").toInt(); +} + +void CAgoraConfig::setLightenging(int lightening) +{ + return m_spConfig->setValue("/Beauty/Lightening", lightening); +} + +int CAgoraConfig::getLightenging() +{ + return m_spConfig->value("/Beauty/Lightening").toInt(); +} + +void CAgoraConfig::setSmoothness(int smooth) +{ + return m_spConfig->setValue("/Beauty/Smoothness", smooth); +} + +int CAgoraConfig::getSmoothness() +{ + return m_spConfig->value("/Beauty/Smoothness").toInt(); +} \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/agoraconfig.h b/Group-Video/OpenVideoCall-Windows/agoraconfig.h new file mode 100644 index 00000000..2eca306f --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/agoraconfig.h @@ -0,0 +1,39 @@ +#ifndef CAGORACONFIG_H +#define CAGORACONFIG_H +#include +#include + +class CAgoraConfig +{ +public: + CAgoraConfig(); + + void setAppId(const QString &str); + QString getAppId(); + void setChannelName(const QString &str); + QString getChannelName(); + void setEnableVideo(bool bEnable); + bool getEnableVideo(); + void setEnableAudio(bool bEnable); + bool getEnableAudio(); + + + void setEnableBeauty(bool bEnable); + bool getEnableBeauty(); + + void setLigtheningContrastLevel(int level); + int getLigtheningContrastLevel(); + + void setRedness(int level); + int getRedness(); + + void setLightenging(int lightening); + int getLightenging(); + + void setSmoothness(int smooth); + int getSmoothness(); +private: + std::shared_ptr m_spConfig; +}; + +#endif // CAGORACONFIG_H diff --git a/Group-Video/OpenVideoCall-Windows/agoraobject.cpp b/Group-Video/OpenVideoCall-Windows/agoraobject.cpp new file mode 100644 index 00000000..4b0209c7 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/agoraobject.cpp @@ -0,0 +1,465 @@ +#include "agoraobject.h" +#include +#include + +CAgoraConfig gAgoraConfig; + +class AgoraRtcEngineEvent : public agora::rtc::IRtcEngineEventHandler +{ + CAgoraObject& m_pInstance; +public: + AgoraRtcEngineEvent(CAgoraObject& engine) + :m_pInstance(engine) + {} + + virtual void onVideoStopped() override + { + emit m_pInstance.sender_videoStopped(); + } + virtual void onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) override + { + emit m_pInstance.sender_joinedChannelSuccess(QString(channel),uid,elapsed); + } + virtual void onUserJoined(uid_t uid, int elapsed) override + { + //qDebug("%s %u",__FUNCTION__,uid); + emit m_pInstance.sender_userJoined(uid, elapsed); + } + virtual void onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) override + { + emit m_pInstance.sender_userOffline(uid, reason); + } + virtual void onFirstLocalVideoFrame(int width, int height, int elapsed) override + { + emit m_pInstance.sender_firstLocalVideoFrame(width, height, elapsed); + } + virtual void onFirstRemoteVideoDecoded(uid_t uid, int width, int height, int elapsed) override + { + emit m_pInstance.sender_firstRemoteVideoDecoded(uid, width, height, elapsed); + } + virtual void onFirstRemoteVideoFrame(uid_t uid, int width, int height, int elapsed) override + { + emit m_pInstance.sender_firstRemoteVideoFrameDrawn(uid, width, height, elapsed); + } + virtual void onLocalVideoStats(const LocalVideoStats &stats) override + { + emit m_pInstance.sender_localVideoStats(stats); + } + virtual void onRemoteVideoStats(const RemoteVideoStats &stats) override + { + emit m_pInstance.sender_remoteVideoStats(stats); + } + virtual void onRtcStats(const RtcStats &stats) override + { + emit m_pInstance.sender_rtcStats(stats); + } + virtual void onLastmileQuality(int quality) override + { + emit m_pInstance.sender_lastmileQuality(quality); + } + virtual void onLastmileProbeResult(const LastmileProbeResult &result) override + { + emit m_pInstance.sender_lastmileProbeResult(result); + } +}; + +CAgoraObject* CAgoraObject::getInstance(QObject *parent) +{ + std::lock_guard autoLock(m_mutex); + if(nullptr == m_pInstance) + m_pInstance = new CAgoraObject(parent); + + return m_pInstance; +} + +CAgoraObject* CAgoraObject::m_pInstance = nullptr; +std::mutex CAgoraObject::m_mutex; + +CAgoraObject::CAgoraObject(QObject *parent): + QObject(parent), + m_rtcEngine(createAgoraRtcEngine()), + m_eventHandler(new AgoraRtcEngineEvent(*this)) +{ + agora::rtc::RtcEngineContext context; + context.eventHandler = m_eventHandler.get(); + QByteArray temp; + if(strlen(APPID)) + context.appId = APPID; + else { + QString strAppId = gAgoraConfig.getAppId(); + temp = strAppId.toUtf8(); + context.appId = const_cast(temp.data()); + } + if (*context.appId == '\0') + { + QMessageBox::critical(nullptr, ("AgoraOpenLive"), + ("You must specify APP ID before using the demo")); + } + m_rtcEngine->initialize(context); +} + +CAgoraObject::~CAgoraObject() +{ + if(m_rtcEngine) + m_rtcEngine->release(); +} + +int CAgoraObject::joinChannel(const QString& key, const QString& channel, uint uid) +{ + if (channel.isEmpty()) { + QMessageBox::warning(nullptr,("AgoraHighSound"),("channelname is empty")); + return -1; + } + + m_rtcEngine->startPreview(); + int r = m_rtcEngine->joinChannel(key.toUtf8().data(), channel.toUtf8().data(), nullptr, uid); + + return r; +} + +int CAgoraObject::leaveChannel() +{ + m_rtcEngine->stopPreview(); + int r = m_rtcEngine->leaveChannel(); + return r; +} + +int CAgoraObject::muteLocalAudioStream(bool muted) +{ + RtcEngineParameters rep(*m_rtcEngine); + return rep.muteLocalAudioStream(muted); +} + +BOOL CAgoraObject::LocalVideoPreview(HWND hVideoWnd, BOOL bPreviewOn, RENDER_MODE_TYPE renderType/* = RENDER_MODE_TYPE::RENDER_MODE_FIT*/) +{ + int nRet = 0; + + if (bPreviewOn) { + VideoCanvas vc; + + vc.uid = 0; + vc.view = hVideoWnd; + vc.renderMode = renderType; + + m_rtcEngine->setupLocalVideo(vc); + nRet = m_rtcEngine->startPreview(); + } + else + nRet = m_rtcEngine->stopPreview(); + + return nRet == 0 ? TRUE : FALSE; +} + +BOOL CAgoraObject::RemoteVideoRender(uid_t uid, HWND hVideoWnd, RENDER_MODE_TYPE renderType/* = RENDER_MODE_TYPE::RENDER_MODE_HIDDEN*/) +{ + int nRet = 0; + + VideoCanvas vc; + + vc.uid = uid; + vc.view = hVideoWnd; + vc.renderMode = renderType; + + m_rtcEngine->setupRemoteVideo(vc); + + return nRet == 0 ? TRUE : FALSE; +} + +BOOL CAgoraObject::startLastMileProbeTest(bool enable) +{ + int nres = 0; + if(enable) { + LastmileProbeConfig lp; + lp.probeUplink =true; + lp.probeDownlink = true; + lp.expectedDownlinkBitrate = 5000; + lp.expectedUplinkBitrate = 5000; + + nres = m_rtcEngine->startLastmileProbeTest(lp); + } + else { + nres = m_rtcEngine->stopLastmileProbeTest(); + } + + return nres == 0? TRUE : FALSE; +} + +int CAgoraObject::enableVideo(bool enabled) +{ + return enabled ? m_rtcEngine->enableVideo() : m_rtcEngine->disableVideo(); +} + +int CAgoraObject::enableAudio(bool enabled) +{ + return enabled ? m_rtcEngine->enableAudio() : m_rtcEngine->disableAudio(); +} + +BOOL CAgoraObject::setLogPath(const QString &strDir) +{ + int ret = 0; + + RtcEngineParameters rep(*m_rtcEngine); + ret = rep.setLogFile(strDir.toUtf8().data()); + + return ret == 0 ? TRUE : FALSE; +} + +BOOL CAgoraObject::SetChannelProfile(CHANNEL_PROFILE_TYPE channelType) +{ + int ret = 0; + ret = m_rtcEngine->setChannelProfile(channelType); + + return ret == 0 ? TRUE : FALSE; +} + +BOOL CAgoraObject::SetClientRole(CLIENT_ROLE_TYPE roleType) +{ + int ret = 0; + + ret = m_rtcEngine->setClientRole(roleType); + + return ret == 0 ? TRUE : FALSE; +} + +BOOL CAgoraObject::EnableWebSdkInteroperability(BOOL bEnable) +{ + RtcEngineParameters rep(*m_rtcEngine); + + int nRet = rep.enableWebSdkInteroperability(static_cast(bEnable)); + + return nRet == 0 ? TRUE : FALSE; +} + +qSSMap CAgoraObject::getRecordingDeviceList() +{ + qSSMap devices; + AAudioDeviceManager audioDeviceManager(m_rtcEngine); + if (!audioDeviceManager) + return devices; + + agora::util::AutoPtr spCollection(audioDeviceManager->enumerateRecordingDevices()); + if (!spCollection) + return devices; + char name[MAX_DEVICE_ID_LENGTH], guid[MAX_DEVICE_ID_LENGTH]; + int count = spCollection->getCount(); + if (count > 0) + { + for (int i = 0; i < count; i++) + { + if (!spCollection->getDevice(i, name, guid)) + { + devices[name] = guid; + } + } + } + return devices; +} + +qSSMap CAgoraObject::getPlayoutDeviceList() +{ + qSSMap devices; + AAudioDeviceManager audioDeviceManager(m_rtcEngine); + if (!audioDeviceManager) + return devices; + + agora::util::AutoPtr spCollection(audioDeviceManager->enumeratePlaybackDevices()); + if (!spCollection) + return devices; + char name[MAX_DEVICE_ID_LENGTH], guid[MAX_DEVICE_ID_LENGTH]; + int count = spCollection->getCount(); + if (count > 0) + { + for (int i = 0; i < count; i++) + { + if (!spCollection->getDevice(i, name, guid)) + { + devices[name] = guid; + } + } + } + return devices; +} + +qSSMap CAgoraObject::getVideoDeviceList() +{ + m_rtcEngine->enableVideo(); + qSSMap devices; + AVideoDeviceManager videoDeviceManager(m_rtcEngine); + if (!videoDeviceManager) + return devices; + + agora::util::AutoPtr spCollection(videoDeviceManager->enumerateVideoDevices()); + if (!spCollection) + return devices; + char name[MAX_DEVICE_ID_LENGTH], guid[MAX_DEVICE_ID_LENGTH]; + int count = spCollection->getCount(); + if (count > 0) + { + for (int i = 0; i < count; i++) + { + if (!spCollection->getDevice(i, name, guid)) + { + devices[name] = guid; + } + } + } + return devices; +} + +int CAgoraObject::setRecordingDevice(const QString& guid) +{ + if (guid.isEmpty()) + return -1; + AAudioDeviceManager audioDeviceManager(m_rtcEngine); + if (!audioDeviceManager) + return -1; + return audioDeviceManager->setRecordingDevice(guid.toUtf8().data()); +} + +int CAgoraObject::setPlayoutDevice(const QString& guid) +{ + if (guid.isEmpty()) + return -1; + AAudioDeviceManager audioDeviceManager(m_rtcEngine); + if (!audioDeviceManager) + return -1; + return audioDeviceManager->setPlaybackDevice(guid.toUtf8().data()); +} + +int CAgoraObject::setVideoDevice(const QString& guid) +{ + if (guid.isEmpty()) + return -1; + AVideoDeviceManager videoDeviceManager(m_rtcEngine); + if (!videoDeviceManager) + return -1; + return videoDeviceManager->setDevice(guid.toUtf8().data()); +} + +BOOL CAgoraObject::setVideoProfile(int nWidth,int nHeight) +{ + int res = 0; + VideoEncoderConfiguration vec; + vec = VideoEncoderConfiguration(nWidth,nHeight,FRAME_RATE_FPS_15,500,ORIENTATION_MODE_FIXED_LANDSCAPE); + res = m_rtcEngine->setVideoEncoderConfiguration(vec); + + return res ==0 ? TRUE : FALSE; +} + +BOOL CAgoraObject::setRecordingIndex(int nIndex) +{ + int res = 0; + AAudioDeviceManager audioDeviceManager(m_rtcEngine); + if (!audioDeviceManager) + return FALSE; + + agora::util::AutoPtr spCollection(audioDeviceManager->enumerateRecordingDevices()); + if (!spCollection) + return FALSE; + char name[MAX_DEVICE_ID_LENGTH], guid[MAX_DEVICE_ID_LENGTH]; + int count = spCollection->getCount(); + assert(res < count); + spCollection->getDevice(nIndex,name,guid); + res = spCollection->setDevice(guid); + + return res ==0 ? TRUE:FALSE; +} + +BOOL CAgoraObject::setPlayoutIndex(int nIndex) +{ + int res = 0; + AAudioDeviceManager audioDeviceManager(m_rtcEngine); + if (!audioDeviceManager) + return FALSE; + + agora::util::AutoPtr spCollection(audioDeviceManager->enumeratePlaybackDevices()); + if (!spCollection) + return FALSE; + char name[MAX_DEVICE_ID_LENGTH], guid[MAX_DEVICE_ID_LENGTH]; + int count = spCollection->getCount(); + assert(res < count); + spCollection->getDevice(nIndex,name,guid); + res = spCollection->setDevice(guid); + + return res ==0 ? TRUE:FALSE; +} + +BOOL CAgoraObject::setVideoIndex(int nIndex) +{ + + int res = 0; + AVideoDeviceManager videoDeviceManager(m_rtcEngine); + if (!videoDeviceManager) + return FALSE; + + agora::util::AutoPtr spCollection(videoDeviceManager->enumerateVideoDevices()); + if (!spCollection) + return FALSE; + char name[MAX_DEVICE_ID_LENGTH], guid[MAX_DEVICE_ID_LENGTH]; + int count = spCollection->getCount(); + assert(nIndex < count); + spCollection->getDevice(nIndex,name,guid); + res = spCollection->setDevice(guid); + + return res == 0 ? TRUE : FALSE; +} + +BOOL CAgoraObject::MuteLocalVideo(BOOL bMute) +{ + int nRet = 0; + + RtcEngineParameters rep(*m_rtcEngine); + nRet = rep.enableLocalVideo(!bMute); + + return nRet == 0 ? TRUE : FALSE; +} + +BOOL CAgoraObject::MuteLocalAudio(BOOL bMute) +{ + int nRet = 0; + + RtcEngineParameters rep(*m_rtcEngine); + nRet = m_rtcEngine->enableLocalAudio(!bMute); + + return nRet == 0 ? TRUE : FALSE; +} + +BOOL CAgoraObject::SetEncryptionMode(const char* secret,const char* secretMode) +{ + int nRet = 0; + if(secret != nullptr && strlen(secret) > 0 && secretMode != nullptr) { + nRet = m_rtcEngine->setEncryptionSecret(secret); + nRet = m_rtcEngine->setEncryptionMode(secretMode); + } + + return nRet == 0 ? TRUE : FALSE; +} + +BOOL CAgoraObject::SetLogFilter(LOG_FILTER_TYPE logFilterType, LPCTSTR lpLogPath) +{ + int nRet = 0; + RtcEngineParameters rep(*m_rtcEngine); + + nRet = rep.setLogFilter(logFilterType); + + if (lpLogPath != Q_NULLPTR) { +#ifdef UNICODE + CHAR szFilePath[MAX_PATH]; + ::WideCharToMultiByte(CP_ACP, 0, lpLogPath, -1, szFilePath, MAX_PATH, nullptr, nullptr); + nRet |= rep.setLogFile(szFilePath); +#else + nRet |= rep.setLogFile(lpLogPath); +#endif + } + + return nRet == 0 ? TRUE : FALSE; +} + + +bool CAgoraObject::setBeautyEffectOptions(bool enabled, BeautyOptions& options) +{ + int nRet = 0; + + nRet = m_rtcEngine->setBeautyEffectOptions(enabled, options); + return nRet == 0 ? true : false; +} \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/agoraobject.h b/Group-Video/OpenVideoCall-Windows/agoraobject.h new file mode 100644 index 00000000..5867b5cc --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/agoraobject.h @@ -0,0 +1,89 @@ +#ifndef CAGORAOBJECT_H +#define CAGORAOBJECT_H + +#include +#include + +#include "agoraconfig.h" +extern CAgoraConfig gAgoraConfig; + +//Specify your APP ID here +#define APPID "" +#define APP_TOKEN "" + +#include +#include +#include +#include +#include +using namespace agora; +using namespace agora::rtc; + +typedef QMap qSSMap; + +class CAgoraObject:public QObject +{ + Q_OBJECT +public: + + int joinChannel(const QString& key, const QString& channel, uint uid); + int leaveChannel(); + int muteLocalAudioStream(bool muted); + BOOL LocalVideoPreview(HWND hVideoWnd, BOOL bPreviewOn, RENDER_MODE_TYPE renderType = RENDER_MODE_TYPE::RENDER_MODE_FIT); + BOOL RemoteVideoRender(uid_t uid, HWND hVideoWnd, RENDER_MODE_TYPE renderType = RENDER_MODE_TYPE::RENDER_MODE_HIDDEN); + + BOOL startLastMileProbeTest(bool enable); + int enableVideo(bool enabled); + int enableAudio(bool enabled); + BOOL MuteLocalVideo(BOOL bMute); + BOOL MuteLocalAudio(BOOL bMute); + BOOL SetEncryptionMode(const char* secret,const char* secretMode); + + BOOL setLogPath(const QString &strDir); + BOOL SetChannelProfile(CHANNEL_PROFILE_TYPE channelType); + BOOL SetClientRole(CLIENT_ROLE_TYPE roleType); + BOOL EnableWebSdkInteroperability(BOOL bEnable); + + qSSMap getRecordingDeviceList(); + qSSMap getPlayoutDeviceList(); + qSSMap getVideoDeviceList(); + + int setRecordingDevice(const QString& guid); + int setPlayoutDevice(const QString& guid); + int setVideoDevice(const QString& guid); + + BOOL setVideoProfile(int nWidth,int nHeight); + BOOL setRecordingIndex(int nIndex); + BOOL setPlayoutIndex(int nIndex); + BOOL setVideoIndex(int nIndex); + BOOL SetLogFilter(LOG_FILTER_TYPE logFilterType, LPCTSTR lpLogPath); + + bool setBeautyEffectOptions(bool enabled, BeautyOptions& options); +signals: + void sender_videoStopped(); + void sender_joinedChannelSuccess(const QString &qsChannel, unsigned int uid, int elapsed); + void sender_userJoined(unsigned int uid, int elapsed); + void sender_userOffline(unsigned int uid, USER_OFFLINE_REASON_TYPE reason); + void sender_firstLocalVideoFrame(int width, int height, int elapsed); + void sender_firstRemoteVideoDecoded(unsigned int uid, int width, int height, int elapsed); + void sender_firstRemoteVideoFrameDrawn(unsigned int uid, int width, int height, int elapsed); + void sender_localVideoStats(const LocalVideoStats &stats); + void sender_remoteVideoStats(const RemoteVideoStats &stats); + void sender_rtcStats(const RtcStats &stats); + void sender_lastmileQuality(int quality); + void sender_lastmileProbeResult(const LastmileProbeResult &result); + +public: + static CAgoraObject* getInstance(QObject *parent = 0); + static CAgoraObject* m_pInstance; + static std::mutex m_mutex; + +private: + explicit CAgoraObject(QObject *parent = 0); + ~CAgoraObject(); + + agora::rtc::IRtcEngine* m_rtcEngine; + std::unique_ptr m_eventHandler; +}; + +#endif // CAGORAOBJECT_H diff --git a/Group-Video/OpenVideoCall-Windows/agorawindowmanager.cpp b/Group-Video/OpenVideoCall-Windows/agorawindowmanager.cpp new file mode 100644 index 00000000..b521b584 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/agorawindowmanager.cpp @@ -0,0 +1,47 @@ +#include "agorawindowmanager.h" + +AgoraWindowManager* AgoraWindowManager::m_pInstance = Q_NULLPTR; +std::mutex AgoraWindowManager::m_mutexMgr; + +AgoraWindowManager* AgoraWindowManager::getInstance() +{ + std::lock_guard autolock(m_mutexMgr); + if(Q_NULLPTR == m_pInstance) + m_pInstance = new AgoraWindowManager; + + return m_pInstance; +} + +void AgoraWindowManager::releaseInstance() +{ + std::lock_guard autoLock(m_mutexMgr); + if(Q_NULLPTR != m_pInstance) + delete m_pInstance; + + m_pInstance = Q_NULLPTR; +} + +AgoraWindowManager::AgoraWindowManager() +{ + +} + +AgoraWindowManager::~AgoraWindowManager() +{ +} + +void AgoraWindowManager::insertItem(eQMainWndType type,QMainWindow* pWnd) +{ + std::lock_guard autolock(m_mutexMgr); + m_qmapeq[type] = pWnd; +} + +QMainWindow* AgoraWindowManager::getQWnd(eQMainWndType type) +{ + std::lock_guard autolock(m_mutexMgr); + QMainWindow* pWndTemp = Q_NULLPTR; + if(m_qmapeq.contains(type)) + pWndTemp = m_qmapeq.value(type); + + return pWndTemp; +} diff --git a/Group-Video/OpenVideoCall-Windows/agorawindowmanager.h b/Group-Video/OpenVideoCall-Windows/agorawindowmanager.h new file mode 100644 index 00000000..f9663a03 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/agorawindowmanager.h @@ -0,0 +1,38 @@ +#ifndef AGORAWINDOWMANAGER_H +#define AGORAWINDOWMANAGER_H + +#include +#include +#include + +enum eQMainWndType { + qWndType_NULL = -1, + qWndType_OpenVideoCall, + qWndType_AvDevice, + qWndType_NetTesting, + qWndType_NetTestResult, + qWndType_NetTestDetail, + qWndType_InRoom, + qWndType_EnterRoom, + + qWndType_UNKNOWN = 0xff, +}; + +typedef QMap qMapeq; +class AgoraWindowManager +{ +public: + static AgoraWindowManager* getInstance(); + static void releaseInstance(); + void insertItem(eQMainWndType type,QMainWindow* pWnd); + QMainWindow* getQWnd(eQMainWndType type); + +private: + AgoraWindowManager(); + ~AgoraWindowManager(); + static AgoraWindowManager* m_pInstance; + qMapeq m_qmapeq; + static std::mutex m_mutexMgr; +}; + +#endif // AGORAWINDOWMANAGER_H diff --git a/Group-Video/OpenVideoCall-Windows/avdevice.cpp b/Group-Video/OpenVideoCall-Windows/avdevice.cpp new file mode 100644 index 00000000..d8581b00 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/avdevice.cpp @@ -0,0 +1,395 @@ +#include "avdevice.h" +#include "ui_avdevice.h" +#include "agoraobject.h" +#include "agorawindowmanager.h" +#include +AVDevice::AVDevice(QMainWindow* pLastWnd,const QString &qsChanne,QWidget *parent) : + QMainWindow(parent), + m_lastWnd(pLastWnd), + ui(new Ui::AVDevice), + m_bEnableAudio(true), + m_bEnableVideo(true), + m_bEnableBeauty(false), + m_strChannel(qsChanne) +{ + ui->setupUi(this); + ui->scrollArea->verticalScrollBar()->setStyleSheet(QLatin1String("" + "QScrollBar:vertical {border: none;background-color: rgb(255,255,255);width: 10px;margin: 0px 0 0px 0;}" + " QScrollBar::handle:vertical { background: rgba(240, 240, 240, 255); min-height: 20px;width: 6px;border: 1px solid rgba(240, 240, 240, 255);border-radius: 3px;margin-left:2px;margin-right:2px;}" + " QScrollBar::add-line:vertical {background-color: rgb(255,255,255);height: 4px;}" + " QScrollBar::sub-line:vertical {background-color: rgb(255,255,255);height: 4px;}" + " QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical {height: 0px;}" + " QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {background: none;}")); + + m_bEnableBeauty = gAgoraConfig.getEnableBeauty(); + m_bEnableAudio = gAgoraConfig.getEnableAudio(); + m_bEnableVideo = gAgoraConfig.getEnableVideo(); + connect(ui->horizontalSlider_Redness, &QSlider::valueChanged, this, &AVDevice::on_valueChanged_horizontalSlider_Redness); + connect(ui->horizontalSlider_Smoothness, &QSlider::valueChanged, this, &AVDevice::on_valueChanged_horizontalSlider_Smoothness); + connect(ui->horizontalSliderLightening, &QSlider::valueChanged, this, &AVDevice::on_valueChanged_horizontalSlider_Lightening); + + this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint); + this->setAttribute(Qt::WA_TranslucentBackground); + + initCtrl(); + + AgoraWindowManager::getInstance()->insertItem(qWndType_AvDevice,this); +} + +AVDevice::~AVDevice() +{ + delete ui; +} + +void AVDevice::mousePressEvent(QMouseEvent *e) +{ + if(e->button() == Qt::LeftButton) { + m_mousePosition = e->pos(); + if(m_mousePosition.x() < lnTitleWidth && + m_mousePosition.x() >= lnGapWidth && + m_mousePosition.y() >= lnGapHeight && + m_mousePosition.y() < lnTitleHeight) + m_bMousePressed = true; + } +} + +void AVDevice::mouseMoveEvent(QMouseEvent *e) +{ + if(m_bMousePressed == true) { + QPoint movePos = e->globalPos() - m_mousePosition; + move(movePos); + e->accept(); + } +} + +void AVDevice::mouseReleaseEvent(QMouseEvent *e) +{ + m_bMousePressed = false; +} + +void AVDevice::initCtrl() +{ + ui->lb_channel->setText(m_strChannel); + setStyleSheet_audio(m_bEnableAudio); + setStyleSheet_video(m_bEnableVideo); + + //videoProfile + ui->cb_solution->clear(); + ui->cb_solution->addItem("160x120"); + ui->cb_solution->addItem("320x180"); + ui->cb_solution->addItem("320x240"); + ui->cb_solution->addItem("640x360"); + ui->cb_solution->addItem("640x480"); + ui->cb_solution->addItem("1280x720"); + ui->cb_solution->addItem("1920x1080"); + ui->cb_solution->addItem("3840x2160"); + ui->cb_solution->setCurrentIndex(3); + + //microphone. + ui->cb_audio->clear(); + QString qDeviceName; + qSSMap devicelist = CAgoraObject::getInstance()->getRecordingDeviceList(); + for (qSSMap::iterator it = devicelist.begin(); devicelist.end() != it; it++) { + ui->cb_audio->addItem(it.key()); + } + + //playout. + ui->cb_speaker->clear(); + devicelist.clear(); + devicelist = CAgoraObject::getInstance()->getPlayoutDeviceList(); + for(qSSMap::iterator it = devicelist.begin(); devicelist.end() != it; it++) { + ui->cb_speaker->addItem(it.key()); + } + + //cameralist + ui->cb_video->clear(); + devicelist.clear(); + devicelist = CAgoraObject::getInstance()->getVideoDeviceList(); + for(qSSMap::iterator it = devicelist.begin(); devicelist.end() != it; it++) { + ui->cb_video->addItem(it.key()); + } + + //log filter + ui->cb_log->clear(); + ui->cb_log->addItem("OFF"); + ui->cb_log->addItem("DEBUG"); + ui->cb_log->addItem("INFO"); + ui->cb_log->addItem("WARN"); + ui->cb_log->addItem("ERROR"); + ui->cb_log->addItem("CRITICAL"); + ui->cb_log->addItem("MASK"); + ui->cb_log->setCurrentIndex(2); + + m_bEnableBeauty = gAgoraConfig.getEnableBeauty(); + + if (!m_bEnableBeauty) { + QString str = "QPushButton:!hover {\ + border-image: url(:/uiresource/switch-off.png);\ + background-image: url(:/uiresource/switch-off.png);\ + }\ + \ + QPushButton:hover {\ + border-image: url(:/uiresource/switch-off.png);\ + background-image: url(:/uiresource/switch-off.png);\ + }"; + + ui->optVideo_Beauty->setStyleSheet(str); + } + else { + QString str = "QPushButton:!hover {\ + border-image: url(:/uiresource/switch-open.png);\ + background-image: url(:/uiresource/switch-open.png);\ + }\ + \ + QPushButton:hover {\ + border-image: url(:/uiresource/switch-open.png);\ + background-image: url(:/uiresource/switch-open.png);\ + }"; + + ui->optVideo_Beauty->setStyleSheet(str); + } + //beauty + ui->cbContrastLevel->clear(); + ui->cbContrastLevel->addItem(QString("Lightening Contrast Low")); + ui->cbContrastLevel->addItem(QString("Lightening Contrast Normal")); + ui->cbContrastLevel->addItem(QString("Lightening Contrast High")); + + ui->cbContrastLevel->setCurrentIndex(gAgoraConfig.getLigtheningContrastLevel()); + + ui->horizontalSlider_Redness->setValue(gAgoraConfig.getRedness()); + ui->horizontalSliderLightening->setValue(gAgoraConfig.getLightenging()); + ui->horizontalSlider_Smoothness->setValue(gAgoraConfig.getSmoothness()); +} + + +void AVDevice::setStyleSheet_audio(bool bEnable) +{ + QString qsStyle ; + if(bEnable) { + qsStyle = "QPushButton:!pressed {\ + width:50px;\ + height:30px;\ + border-radius:19px;\ + image: url(:/uiresource/switch-open.png)\ + }" \ + "QPushButton:pressed {\ + width:50px;\ + height:30px;\ + border-radius:19px;\ + image: url(:/uiresource/switch-open.png)\ + }"; + } + else { + qsStyle = "QPushButton:!pressed {\ + width:50px;\ + height:30px;\ + border-radius:19px;\ + image: url(:/uiresource/switch-off.png)\ + }"\ + "QPushButton:pressed {\ + width:50px;\ + height:30px;\ + border-radius:19px;\ + image: url(:/uiresource/switch-off.png)\ + }"; + + } + + ui->btn_audio->setStyleSheet(qsStyle); +} + +void AVDevice::setStyleSheet_video(bool bEnable) +{ + QString qsStyle; + if(bEnable) { + qsStyle = "QPushButton:!pressed {\ + width:50px;\ + height:30px;\ + border-radius:19px;\ + image: url(:/uiresource/switch-open.png)\ + }"\ + "QPushButton:pressed {\ + width:50px;\ + height:30px;\ + border-radius:19px;\ + image: url(:/uiresource/switch-open.png)\ + }"; + } + else { + qsStyle = "QPushButton:!pressed {\ + width:50px;\ + height:30px;\ + border-radius:19px;\ + image: url(:/uiresource/switch-off.png)\ + }"\ + "QPushButton:pressed {\ + width:50px;\ + height:30px;\ + border-radius:19px;\ + image: url(:/uiresource/switch-off.png)\ + }"; + } + ui->btn_video->setStyleSheet(qsStyle); +} + + +void AVDevice::enableVideoBeutyControl(bool bEnable) +{ + ui->cbContrastLevel->setDisabled(bEnable); + ui->horizontalSliderLightening->setDisabled(bEnable); + ui->horizontalSlider_Redness->setDisabled(bEnable); + ui->horizontalSlider_Smoothness->setDisabled(bEnable); +} + +void AVDevice::on_optVideo_Beauty_clicked() +{ + m_bEnableBeauty = !m_bEnableBeauty; + enableVideoBeutyControl(!m_bEnableBeauty); + updateBeautyOptions(); + if (!m_bEnableBeauty) { + QString str = "QPushButton:!hover {\ + border-image: url(:/uiresource/switch-off.png);\ + background-image: url(:/uiresource/switch-off.png);\ + }\ + \ + QPushButton:hover {\ + border-image: url(:/uiresource/switch-off.png);\ + background-image: url(:/uiresource/switch-off.png);\ + }"; + + ui->optVideo_Beauty->setStyleSheet(str); + + } + else { + QString str = "QPushButton:!hover {\ + border-image: url(:/uiresource/switch-open.png);\ + background-image: url(:/uiresource/switch-open.png);\ + }\ + \ + QPushButton:hover {\ + border-image: url(:/uiresource/switch-open.png);\ + background-image: url(:/uiresource/switch-open.png);\ + }"; + + ui->optVideo_Beauty->setStyleSheet(str); + } + + gAgoraConfig.setEnableBeauty(m_bEnableBeauty); +} + +void AVDevice::on_btn_back_clicked() +{ + if(m_lastWnd) + m_lastWnd->show(); + this->hide(); +} + +void AVDevice::on_cb_solution_activated(int index) +{ +} + +void AVDevice::on_cb_audio_activated(int index) +{ + CAgoraObject::getInstance()->setRecordingIndex(index); +} + +void AVDevice::on_cb_video_activated(int index) +{ + CAgoraObject::getInstance()->setVideoIndex(index); +} + +void AVDevice::on_cb_speaker_activated(int index) +{ + CAgoraObject::getInstance()->setPlayoutIndex(index); +} + +void AVDevice::on_btn_audio_clicked() +{ + m_bEnableAudio = !m_bEnableAudio; + setStyleSheet_audio(m_bEnableAudio); + gAgoraConfig.setEnableAudio(m_bEnableAudio); +} + +void AVDevice::on_btn_video_clicked() +{ + m_bEnableVideo = !m_bEnableVideo; + setStyleSheet_video(m_bEnableVideo); + gAgoraConfig.setEnableVideo(m_bEnableVideo); +} + +void AVDevice::on_btn_close_clicked() +{ + on_btn_back_clicked(); +} + +void AVDevice::on_btn_min_clicked() +{ + this->showMinimized(); +} + +void AVDevice::on_cb_solution_activated(const QString &arg1) +{ + int nWidth,nHeight = 0; + sscanf(arg1.toUtf8().data(),"%dx%d", &nWidth, &nHeight); + CAgoraObject::getInstance()->setVideoProfile(nWidth, nHeight); +} + +void AVDevice::on_cb_log_activated(int index) +{ + LOG_FILTER_TYPE logFilterType = LOG_FILTER_OFF; + switch (index) + { + case 0:logFilterType = LOG_FILTER_OFF; break; + case 1:logFilterType = LOG_FILTER_DEBUG;break; + case 2:logFilterType = LOG_FILTER_INFO; break; + case 3:logFilterType = LOG_FILTER_WARN; break; + case 4:logFilterType = LOG_FILTER_ERROR; break; + case 5:logFilterType = LOG_FILTER_CRITICAL; break; + case 6:logFilterType = LOG_FILTER_MASK; break; + default:break; + } + CAgoraObject::getInstance()->SetLogFilter(logFilterType,L""); +} + +void AVDevice::updateBeautyOptions() +{ + BeautyOptions options; + options.lighteningContrastLevel = (BeautyOptions::LIGHTENING_CONTRAST_LEVEL)ui->cbContrastLevel->currentIndex(); + options.lighteningLevel = ui->horizontalSliderLightening->value() / 100.0f; + options.rednessLevel = ui->horizontalSlider_Redness->value() / 100.0f; + options.smoothnessLevel = ui->horizontalSlider_Smoothness->value() / 100.0f; + + CAgoraObject::getInstance()->setBeautyEffectOptions(m_bEnableBeauty, options); +} + +void AVDevice::on_cbContrastLevel_activated(int index) +{ + updateBeautyOptions(); +} + +void AVDevice::on_valueChanged_horizontalSlider_Redness(int value) +{ + QString redness; + redness.sprintf("Redness(%.02f)", value / 100.0f); + ui->labelRedness->setText(redness); + gAgoraConfig.setRedness(value); + updateBeautyOptions(); +} + +void AVDevice::on_valueChanged_horizontalSlider_Smoothness(int value) +{ + QString smooth; + smooth.sprintf("Smoothness(%.02f)", value / 100.0f); + ui->labelSmoothness->setText(smooth); + gAgoraConfig.setSmoothness(value); + updateBeautyOptions(); +} + +void AVDevice::on_valueChanged_horizontalSlider_Lightening(int value) +{ + QString lightening; + lightening.sprintf("Lightening(%.02f)", value / 100.0f); + ui->labelLightening->setText(lightening); + gAgoraConfig.setLightenging(value); + updateBeautyOptions(); +} diff --git a/Group-Video/OpenVideoCall-Windows/avdevice.h b/Group-Video/OpenVideoCall-Windows/avdevice.h new file mode 100644 index 00000000..eff6ad9b --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/avdevice.h @@ -0,0 +1,71 @@ +#ifndef AVDEVICE_H +#define AVDEVICE_H + +#include +#include + +namespace Ui { +class AVDevice; +} + +class AVDevice : public QMainWindow +{ + Q_OBJECT + +public: + explicit AVDevice(QMainWindow* pLastWnd,const QString &qsChanne,QWidget *parent = 0); + ~AVDevice(); + +protected: + virtual void mousePressEvent(QMouseEvent *e); + virtual void mouseMoveEvent(QMouseEvent *e); + virtual void mouseReleaseEvent(QMouseEvent *e); + + void initCtrl(); + void setStyleSheet_audio(bool bEnable); + void setStyleSheet_video(bool bEnable); + +private slots: + void on_btn_back_clicked(); + void on_cb_solution_activated(int index); + void on_cb_audio_activated(int index); + void on_cb_video_activated(int index); + void on_cb_speaker_activated(int index); + void on_btn_audio_clicked(); + void on_btn_video_clicked(); + + void on_optVideo_Beauty_clicked(); + + void on_btn_close_clicked(); + + void on_btn_min_clicked(); + + void on_cb_solution_activated(const QString &arg1); + + void on_cb_log_activated(int index); + + void on_cbContrastLevel_activated(int index); + void on_valueChanged_horizontalSlider_Redness(int value); + void on_valueChanged_horizontalSlider_Smoothness(int value); + void on_valueChanged_horizontalSlider_Lightening(int value); +private: + void enableVideoBeutyControl(bool bEnable); + void updateBeautyOptions(); + + const int lnGapWidth = 18; + const int lnGapHeight = 12; + const int lnTitleWidth = 718; + const int lnTitleHeight = 30; + QPoint m_mousePosition; + bool m_bMousePressed; + +private: + Ui::AVDevice *ui; + QMainWindow* m_lastWnd; + QString m_strChannel; + bool m_bEnableVideo; + bool m_bEnableAudio; + bool m_bEnableBeauty; +}; + +#endif // AVDEVICE_H diff --git a/Group-Video/OpenVideoCall-Windows/avdevice.ui b/Group-Video/OpenVideoCall-Windows/avdevice.ui new file mode 100644 index 00000000..84726637 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/avdevice.ui @@ -0,0 +1,1229 @@ + + + AVDevice + + + + 0 + 0 + 786 + 536 + + + + MainWindow + + + + + + + + + + false + + + QWidget#centralwidget { +image: url(:/uiresource/OVC-win-config.png); +} + + + + + 418 + 25 + 36 + 36 + + + + QPushButton:!hover { +width:36px; +height:36px; +border-image: url(:/uiresource/icon-back.png); +image: url(:/uiresource/icon-back.png); +} +QPushButton:hover{ +width:36px; +height:36px; +border-image: url(:/uiresource/icon-back hover.png); +image: url(:/uiresource/icon-back hover.png); +} + + + + + + + + + 698 + 34 + 18 + 18 + + + + QPushButton:!hover { +image: url(:/uiresource/icon-min default.png); +border-image: url(:/uiresource/icon-min default.png); +} + +QPushButton:hover { +image: url(:/uiresource/icon-min hover.png); +border-image: url(:/uiresource/icon-min hover.png); +} + + + + + + + + + 726 + 34 + 18 + 18 + + + + QPushButton:!hover { +image: url(:/uiresource/icon-close default.png); +border-image: url(:/uiresource/icon-close default.png); +} + +QPushButton:hover { +image: url(:/uiresource/icon-close hover.png); +border-image: url(:/uiresource/icon-close hover.png); +} + + + + + + + + true + + + + 425 + 103 + 317 + 22 + + + + border-image: url(:/uiresource/edit1.png); +font-size:16px; +font-family:HelveticaNeue; +color:rgba(51,51,51,1); +line-height:18px; + + + + + + 410 + 80 + 350 + 426 + + + + QScrollArea{ + background-color: rgb(255, 255, 255); + border:none; +}; + + + QFrame::Plain + + + Qt::ScrollBarAlwaysOff + + + true + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + 0 + -141 + 340 + 567 + + + + background-color: rgb(255, 255, 255); + + + + 4 + + + + + + + QLabel{ +font-family: "Arial"; +font-size: 12px; +color:rgb(144,144,144); +}; + + + Name + + + + + + + + HelveticaNeue + -1 + + + + border-image: url(:/uiresource/edit1.png); +image: url(:/uiresource/edit1.png); +font-size:16px; +font-family:HelveticaNeue; +color:rgba(51,51,51,1); +line-height:18px; + + + + + + + + + + + + + 0 + 1 + + + + + 16777215 + 1 + + + + border-top: 1px solid rgb(234, 234, 234); + + + QFrame::Plain + + + Qt::Horizontal + + + + + + + + + QLabel{ +font-family: "Arial"; +font-size: 12px; +color:rgb(144,144,144); +}; + + + Resolution + + + + + + + + 微软雅黑 + -1 + + + + QComboBox { +font-family: "微软雅黑"; +font-size: 13px; +padding: 3px 0x 3px 5px; +border-image: url(:/uiresource/box-01.png); +} + +QComboBox:hover { +font-family: "微软雅黑"; +font-size: 13px; +padding: 3px 0x 3px 5px; +border-image: url(:/uiresource/box-01.png); +} + +QComboBox:pressed { +font-family: "微软雅黑"; +font-size: 13px; +padding: 3px 0x 3px 5px; +border-image: url(:/uiresource/box-01.png); +} + +QComboBox::drop-down { +subcontrol-origin: padding; +subcontrol-position: top right; width: 30 px; +border: 0px; +} + +QComboBox::down-arrow::!on { +image: url(:/uiresource/dropdow-01.png); +} +QComboBox::down-arrow::hover { +image: url(:/uiresource/dropdown-02.png); +} +QComboBox::down-arrow::on { +image: url(:/uiresource/dropdown-03.png); +} + +QListView { +font-family: "微软雅黑"; +font-size: 13px; +outline: 0px; +background-image: url(:/uiresource/list.png); +border-image: url(:/uiresource/list.png); +image: url(:/uiresource/list.png); +} + +QListView::item { +padding: 3px 0x 3px 5px; +border-width: 0px; +} + +QListView::item:selected { +background-color: rgb(74, 144, 226); +} + + + + + + + + + + + border-top: 1px solid rgb(234, 234, 234); + + + QFrame::Plain + + + Qt::Horizontal + + + + + + + + + QLabel{ +font-family: "Arial"; +font-size: 12px; +color:rgb(144,144,144); +}; + + + Audio Device + + + + + + + QComboBox { +font-family: "微软雅黑"; +font-size: 13px; +padding: 3px 0x 3px 5px; +border-image: url(:/uiresource/box-01.png); +} + +QComboBox:hover { +font-family: "微软雅黑"; +font-size: 13px; +padding: 3px 0x 3px 5px; +border-image: url(:/uiresource/box-01.png); +} + +QComboBox:pressed { +font-family: "微软雅黑"; +font-size: 13px; +padding: 3px 0x 3px 5px; +border-image: url(:/uiresource/box-01.png); +} + +QComboBox::drop-down { +subcontrol-origin: padding; +subcontrol-position: top right; width: 30 px; +border: 0px; +} + +QComboBox::down-arrow::!on { +image: url(:/uiresource/dropdow-01.png); +} +QComboBox::down-arrow::hover { +image: url(:/uiresource/dropdown-02.png); +} +QComboBox::down-arrow::on { +image: url(:/uiresource/dropdown-03.png); +} + +QListView { +font-family: "微软雅黑"; +font-size: 13px; +outline: 0px; +background-image: url(:/uiresource/list.png); +border-image: url(:/uiresource/list.png); +image: url(:/uiresource/list.png); +} + +QListView::item { +padding: 3px 0x 3px 5px; +border-width: 0px; +} + +QListView::item:selected { +background-color: rgb(74, 144, 226); +} + + + + + + + + + + + + 0 + 1 + + + + + 16777215 + 1 + + + + border-top: 1px solid rgb(234, 234, 234); + + + QFrame::Plain + + + Qt::Horizontal + + + + + + + + + QLabel{ +font-family: "Arial"; +font-size: 12px; +color:rgb(144,144,144); +}; + + + Video Device + + + + + + + QComboBox { +font-family: "微软雅黑"; +font-size: 13px; +padding: 3px 0x 3px 5px; +border-image: url(:/uiresource/box-01.png); +} + +QComboBox:hover { +font-family: "微软雅黑"; +font-size: 13px; +padding: 3px 0x 3px 5px; +border-image: url(:/uiresource/box-01.png); +} + +QComboBox:pressed { +font-family: "微软雅黑"; +font-size: 13px; +padding: 3px 0x 3px 5px; +border-image: url(:/uiresource/box-01.png); +} + +QComboBox::drop-down { +subcontrol-origin: padding; +subcontrol-position: top right; width: 30 px; +border: 0px; +} + +QComboBox::down-arrow::!on { +image: url(:/uiresource/dropdow-01.png); +} +QComboBox::down-arrow::hover { +image: url(:/uiresource/dropdown-02.png); +} +QComboBox::down-arrow::on { +image: url(:/uiresource/dropdown-03.png); +} + +QListView { +font-family: "微软雅黑"; +font-size: 13px; +outline: 0px; +background-image: url(:/uiresource/list.png); +border-image: url(:/uiresource/list.png); +image: url(:/uiresource/list.png); +} + +QListView::item { +padding: 3px 0x 3px 5px; +border-width: 0px; +} + +QListView::item:selected { +background-color: rgb(74, 144, 226); +} + + + + + + + + + + + + 0 + 1 + + + + + 16777215 + 1 + + + + border-top: 1px solid rgb(234, 234, 234); + + + QFrame::Plain + + + Qt::Horizontal + + + + + + + + + QLabel{ +font-family: "Arial"; +font-size: 12px; +color:rgb(144,144,144); +}; + + + Speaker + + + + + + + QComboBox { +font-family: "微软雅黑"; +font-size: 13px; +padding: 3px 0x 3px 5px; +border-image: url(:/uiresource/box-01.png); +} + +QComboBox:hover { +font-family: "微软雅黑"; +font-size: 13px; +padding: 3px 0x 3px 5px; +border-image: url(:/uiresource/box-01.png); +} + +QComboBox:pressed { +font-family: "微软雅黑"; +font-size: 13px; +padding: 3px 0x 3px 5px; +border-image: url(:/uiresource/box-01.png); +} + +QComboBox::drop-down { +subcontrol-origin: padding; +subcontrol-position: top right; width: 30 px; +border: 0px; +} + +QComboBox::down-arrow::!on { +image: url(:/uiresource/dropdow-01.png); +} +QComboBox::down-arrow::hover { +image: url(:/uiresource/dropdown-02.png); +} +QComboBox::down-arrow::on { +image: url(:/uiresource/dropdown-03.png); +} + +QListView { +font-family: "微软雅黑"; +font-size: 13px; +outline: 0px; +background-image: url(:/uiresource/list.png); +border-image: url(:/uiresource/list.png); +image: url(:/uiresource/list.png); +} + +QListView::item { +padding: 3px 0x 3px 5px; +border-width: 0px; +} + +QListView::item:selected { +background-color: rgb(74, 144, 226); +} + + + + + + + + + + + + 0 + 1 + + + + + 16777215 + 1 + + + + border-top: 1px solid rgb(234, 234, 234); + + + QFrame::Plain + + + Qt::Horizontal + + + + + + + + + QLabel{ +font-family: "Arial"; +font-size: 14px; + +}; + + + Audio + + + + + + + QPushButton:!pressed { +width:50px; +height:30px; +border-radius:19px; +image: url(:/uiresource/switch-open.png); +} + + + + + + + + + + Qt::Horizontal + + + + 20 + 20 + + + + + + + + QLabel{ +font-family: "Arial"; +font-size: 14px; +}; + + + Video + + + + + + + QPushButton:!pressed { +width:50px; +height:30px; +border-radius:19px; +image: url(:/uiresource/switch-open.png); +} + + + + + + + + + + + + + 0 + 1 + + + + + 16777215 + 1 + + + + border-top: 1px solid rgb(234, 234, 234); + + + QFrame::Plain + + + Qt::Horizontal + + + + + + + + + QLabel{ +font-family: "Arial"; +font-size: 12px; +color:rgb(144,144,144); +}; + + + Log Filter + + + + + + + QComboBox { +font-family: "微软雅黑"; +font-size: 13px; +padding: 3px 0x 3px 5px; +border-image: url(:/uiresource/box-01.png); +} + +QComboBox:hover { +font-family: "微软雅黑"; +font-size: 13px; +padding: 3px 0x 3px 5px; +border-image: url(:/uiresource/box-01.png); +} + +QComboBox:pressed { +font-family: "微软雅黑"; +font-size: 13px; +padding: 3px 0x 3px 5px; +border-image: url(:/uiresource/box-01.png); +} + +QComboBox::drop-down { +subcontrol-origin: padding; +subcontrol-position: top right; width: 30 px; +border: 0px; +} + +QComboBox::down-arrow::!on { +image: url(:/uiresource/dropdow-01.png); +} +QComboBox::down-arrow::hover { +image: url(:/uiresource/dropdown-02.png); +} +QComboBox::down-arrow::on { +image: url(:/uiresource/dropdown-03.png); +} + +QListView { +font-family: "微软雅黑"; +font-size: 13px; +outline: 0px; +background-image: url(:/uiresource/list.png); +border-image: url(:/uiresource/list.png); +image: url(:/uiresource/list.png); +} + +QListView::item { +padding: 3px 0x 3px 5px; +border-width: 0px; +} + +QListView::item:selected { +background-color: rgb(74, 144, 226); +} + + + + + + + + + + + + 0 + 1 + + + + + 16777215 + 1 + + + + border-top: 1px solid rgb(234, 234, 234); + + + QFrame::Plain + + + Qt::Horizontal + + + + + + + + + QLabel{ +font-family: "Arial"; +font-size: 12px; +color:rgb(144,144,144); +}; + + + Beauty Effect + + + + + + + Qt::Horizontal + + + + 20 + 20 + + + + + + + + + 50 + 30 + + + + + 50 + 30 + + + + QPushButton:!hover { +border-image: url(:/uiresource/switch-off.png); +background-image: url(:/uiresource/switch-off.png); +} + +QPushButton:hover { +border-image: url(:/uiresource/switch-off.png); +background-image: url(:/uiresource/switch-off.png); +} + + + + + + false + + + + + + + + + + + QLabel{ +font-family: "Arial"; +font-size: 12px; +color:rgb(144,144,144); +}; + + + Contrast Level + + + + + + + Qt::Horizontal + + + + 20 + 20 + + + + + + + + + 194 + 32 + + + + + 194 + 32 + + + + QComboBox { +font-family: "微软雅黑"; +font-size: 13px; +padding: 3px 0x 3px 5px; +border-image: url(:/uiresource/box-01.png); +} + +QComboBox:hover { +font-family: "微软雅黑"; +font-size: 13px; +padding: 3px 0x 3px 5px; +border-image: url(:/uiresource/box-01.png); +} + +QComboBox:pressed { +font-family: "微软雅黑"; +font-size: 13px; +padding: 3px 0x 3px 5px; +border-image: url(:/uiresource/box-01.png); +} + +QComboBox::drop-down { +subcontrol-origin: padding; +subcontrol-position: top right; width: 30 px; +border: 0px; +} + +QComboBox::down-arrow::!on { +image: url(:/uiresource/dropdow-01.png); +} +QComboBox::down-arrow::hover { +image: url(:/uiresource/dropdown-02.png); +} +QComboBox::down-arrow::on { +image: url(:/uiresource/dropdown-03.png); +} + +QListView { +font-family: "微软雅黑"; +font-size: 13px; +outline: 0px; +background-image: url(:/uiresource/list.png); +border-image: url(:/uiresource/list.png); +image: url(:/uiresource/list.png); +} + +QListView::item { +padding: 3px 0x 3px 5px; +border-width: 0px; +} + +QListView::item:selected { +background-color: rgb(74, 144, 226); +} + + + + + + + + + + + + + QLabel{ +font-family: "Arial"; +font-size: 12px; +color:rgb(144,144,144); +}; + + + Lightening(0.00) + + + + + + + QSlider::groove:horizontal { + border:1px; + border-color: rgba(240,240,240,255); + border-radius:3px; + height: 6px; + margin: 0px 0; + left: 4px; right: 4px; + background: rgba(240,240,240,255); + } +QSlider::handle:horizontal { + + background-image: url(:/uiresource/slider.png); + background-repeat: none; background-position: center; + width: 20px; + height: 20px; + margin: -9px 0; +} +QSlider::sub-page:horizontal{ + border:1px; + border-color: #44A2FC; + border-radius:3px; + background: #44A2FC; +}; + + + 100 + + + 1 + + + 10 + + + Qt::Horizontal + + + + + + + + + + + QLabel{ +font-family: "Arial"; +font-size: 12px; +color:rgb(144,144,144); +}; + + + Smoothness(0.00) + + + + + + + QSlider::groove:horizontal { + border:1px; + border-color: rgba(240,240,240,255); + border-radius:3px; + height: 6px; + margin: 0px 0; + left: 4px; right: 4px; + background: rgba(240,240,240,255); + } +QSlider::handle:horizontal { + + background-image: url(:/uiresource/slider.png); + background-repeat: none; background-position: center; + width: 20px; + height: 20px; + margin: -9px 0; +} +QSlider::sub-page:horizontal{ + border:1px; + border-color: #44A2FC; + border-radius:3px; + background: #44A2FC; +}; + + + 100 + + + 1 + + + 10 + + + Qt::Horizontal + + + + + + + + + + + QLabel{ +font-family: "Arial"; +font-size: 12px; +color:rgb(144,144,144); +}; + + + Redness(0.00) + + + + + + + QSlider::groove:horizontal { + border:1px; + border-color: rgba(240,240,240,255); + border-radius:3px; + height: 6px; + margin: 0px 0; + left: 4px; right: 4px; + background: rgba(240,240,240,255); + } +QSlider::handle:horizontal { + + background-image: url(:/uiresource/slider.png); + background-repeat: none; background-position: center; + width: 20px; + height: 20px; + margin: -9px 0; +} +QSlider::sub-page:horizontal{ + border:1px; + border-color: #44A2FC; + border-radius:3px; + background: #44A2FC; +}; + + + 100 + + + 1 + + + 10 + + + Qt::Horizontal + + + + + + + + + + 0 + 1 + + + + + 16777215 + 1 + + + + border-top: 1px solid rgb(234, 234, 234); + + + QFrame::Plain + + + Qt::Horizontal + + + + + + + + + + + diff --git a/Group-Video/OpenVideoCall-Windows/build_release.bat b/Group-Video/OpenVideoCall-Windows/build_release.bat new file mode 100644 index 00000000..e97bf581 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/build_release.bat @@ -0,0 +1,24 @@ +@echo off + +title qmake and nmake build prompt +::C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC +::C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build; +set VCINSTALLDIR=%~1 +::C:\Qt\5.12.2\msvc2017;C:\Qt\5.12.2\msvc2017_64 +set QTDIR=%~2 +::x86;x64 +set Machine=%~3 +echo vsdir: %VCINSTALLDIR% +echo qtdir:%QTDIR% +echo machine:%Machine% + +set PATH=%VCINSTALLDIR%\bin;%QTDIR%\bin;C:\Program Files\7-Zip;%PATH% + +::shadow build +set vsdevpath=%VCINSTALLDIR%\vcvarsall.bat +echo vsdevpath:%vsdevpath% +call "%VCINSTALLDIR%\vcvarsall.bat" %Machine% +qmake OpenVideoCall.pro "CONFIG+=release" "CONFIG+=qml_release" +nmake +cd release +windeployqt OpenVideoCall.exe \ No newline at end of file diff --git a/Group-Video/OpenVideoCall-Windows/enterroom.cpp b/Group-Video/OpenVideoCall-Windows/enterroom.cpp new file mode 100644 index 00000000..b2f6791c --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/enterroom.cpp @@ -0,0 +1,195 @@ +#include "enterroom.h" +#include "ui_enterroom.h" +#include "agoraobject.h" +#include "qgraphicseffect.h" +#include "agorawindowmanager.h" + + EnterRoom::EnterRoom(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::wgEnterRoom) +{ + ui->setupUi(this); + + this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowStaysOnTopHint); + this->setAttribute(Qt::WA_TranslucentBackground); + this->setAttribute(Qt::WA_TransparentForMouseEvents); + + AgoraWindowManager::getInstance()->insertItem(qWndType_EnterRoom,this); +} + +EnterRoom::~EnterRoom() +{ + delete ui; +} + +void EnterRoom::mousePressEvent(QMouseEvent *e) +{ + if(e->button() == Qt::LeftButton) { + m_mousePosition = e->pos(); + if(m_mousePosition.x() < lnTitleWidth && + m_mousePosition.y() < lnTitleHeight) + m_bMousePressed = true; + } +} + +void EnterRoom::mouseMoveEvent(QMouseEvent *e) +{ + if(m_bMousePressed == true) { + QPoint movePos = e->globalPos() - m_mousePosition; + move(movePos); + e->accept(); + } +} + +void EnterRoom::mouseReleaseEvent(QMouseEvent *e) +{ + m_bMousePressed = false; +} + +void EnterRoom::focusInEvent(QFocusEvent *event) +{ + this->show(); +} + +void EnterRoom::focusOutEvent(QFocusEvent *event) +{ + this->hide(); +} + +void EnterRoom::joinchannel(const QString& qsChannel,uint uid) +{ + ui->lbChannel->setText(qsChannel); + this->show(); +} + +void EnterRoom::leavechannel() +{ +} + +void EnterRoom::setChannelName(const QString& qsChannelInfo) +{ + ui->lbChannel->setText(qsChannelInfo); +} + +void EnterRoom::setParam(const QString& qsParam) +{ + ui->lbParam->setText(qsParam); +} + +int EnterRoom::getR1() +{ + return m_uidr1; +} + +int EnterRoom::getR2() +{ + return m_uidr2; +} + +int EnterRoom::getR3() +{ + return m_uidr3; +} + +void EnterRoom::switchUidText(const QString &qsSrc,const QString &qsDest,int nIndex) +{ + QString qsInfo1; + qsInfo1.sprintf("%s,%s,%d",qsSrc.toStdString().c_str(),qsDest.toStdString().c_str(),nIndex); + //qDebug(qsInfo1.toStdString().c_str()); + ui->lbChannel->setText(qsSrc); + if(1 == nIndex) + ui->lb_r1->setText(qsDest); + if(2 == nIndex) + ui->lb_r2->setText(qsDest); + if(3 == nIndex) + ui->lb_r3->setText(qsDest); +} + +void EnterRoom::on_rbCamera_stateChanged(int arg1) +{ + if(arg1 == Qt::Unchecked) + CAgoraObject::getInstance()->MuteLocalVideo(FALSE); + else if(arg1 == Qt::Checked) + CAgoraObject::getInstance()->MuteLocalVideo(TRUE); +} + +void EnterRoom::on_rbMic_stateChanged(int arg1) +{ + if(arg1 == Qt::Unchecked) + CAgoraObject::getInstance()->MuteLocalAudio(FALSE); + else if(arg1 == Qt::Checked) + CAgoraObject::getInstance()->MuteLocalAudio(TRUE); +} + +void EnterRoom::setAllRAtt(int nRCount) +{ + ui->lb_r1->setVisible(false); + ui->lb_r2->setVisible(false); + ui->lb_r3->setVisible(false); + ui->lb_count->setVisible(false); + + if(nRCount >= 1) { + QString qsText; + qsText.sprintf(" uid:%u",m_uidr1); + ui->lb_r1->setText(qsText); + ui->lb_r1->setVisible(true); + + QRect qrt = ui->lb_count->geometry(); + QRect qrt1 = ui->lb_r1->geometry(); + qrt.setTop(qrt1.bottom() + 10); + ui->lb_count->move(qrt.left(),qrt.top()); + ui->lb_count->setVisible(true); + + } + if(nRCount >= 2) { + QString qsText; + qsText.sprintf(" uid:%u",m_uidr2); + ui->lb_r2->setText(qsText); + ui->lb_r2->setVisible(true); + + QRect qrt = ui->lb_count->geometry(); + QRect qrt1 = ui->lb_r2->geometry(); + qrt.setTop(qrt1.bottom() + 10); + ui->lb_count->move(qrt.left(),qrt.top()); + ui->lb_count->setVisible(true); + } + if(nRCount >= 3) { + QString qsText; + qsText.sprintf(" uid:%u",m_uidr3); + ui->lb_r3->setText(qsText); + ui->lb_r3->setVisible(true); + + QRect qrt = ui->lb_count->geometry(); + QRect qrt1 = ui->lb_r3->geometry(); + qrt.setTop(qrt1.bottom() + 10); + ui->lb_count->move(qrt.left(),qrt.top()); + ui->lb_count->setVisible(true); + } + + QString qsCount; + qsCount.sprintf("Total %d Person",nRCount + 1); + ui->lb_count->setText(qsCount); +} + +void EnterRoom::setR1(uid_t uid) +{ + m_uidr1 = uid; +} + +void EnterRoom::setR2(uid_t uid) +{ + m_uidr2 = uid; +} + +void EnterRoom::setR3(uid_t uid) +{ + m_uidr3 = uid; +} + +void EnterRoom::on_btnLeave_clicked() +{ + QMainWindow *pLastWnd = AgoraWindowManager::getInstance()->getQWnd(qWndType_InRoom); + connect(this,SIGNAL(sender_exitChannel()),pLastWnd,SLOT(leavechannel())); + emit sender_exitChannel(); + this->hide(); +} diff --git a/Group-Video/OpenVideoCall-Windows/enterroom.h b/Group-Video/OpenVideoCall-Windows/enterroom.h new file mode 100644 index 00000000..0c6a8166 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/enterroom.h @@ -0,0 +1,68 @@ +#ifndef ENTERROOM_H +#define ENTERROOM_H + +#include +#include +#include + +namespace Ui { +class wgEnterRoom; +} + +class EnterRoom : public QMainWindow +{ + Q_OBJECT + +public: + explicit EnterRoom(QWidget *parent = 0); + ~EnterRoom(); + + void joinchannel(const QString& qsChannel,uint uid); + void leavechannel(); + + void setChannelName(const QString& qsChannelInfo); + void setParam(const QString& qsParam); + + void setAllRAtt(int nRCount); + void setR1(unsigned int uid); + void setR2(unsigned int uid); + void setR3(unsigned int uid); + int getR1(); + int getR2(); + int getR3(); + + void switchUidText(const QString &qsSrc,const QString &qsDest,int nIndex); + +protected: + virtual void mousePressEvent(QMouseEvent *e); + virtual void mouseMoveEvent(QMouseEvent *e); + virtual void mouseReleaseEvent(QMouseEvent *e); + + virtual void focusInEvent(QFocusEvent *event); + virtual void focusOutEvent(QFocusEvent *event); + +signals: + void sender_exitChannel(); + void sender_updateVideo(); + +private slots: + + void on_rbCamera_stateChanged(int arg1); + void on_rbMic_stateChanged(int arg1); + void on_btnLeave_clicked(); + +private: + const int lnTitleWidth = 1366; + const int lnTitleHeight = 30; + QPoint m_mousePosition; + bool m_bMousePressed; + +private: + Ui::wgEnterRoom *ui; + QMainWindow* m_pLastWnd; + unsigned int m_uidr1; + unsigned int m_uidr2; + unsigned int m_uidr3; +}; + +#endif // ENTERROOM_H diff --git a/Group-Video/OpenVideoCall-Windows/enterroom.ui b/Group-Video/OpenVideoCall-Windows/enterroom.ui new file mode 100644 index 00000000..330e4412 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/enterroom.ui @@ -0,0 +1,295 @@ + + + wgEnterRoom + + + + 0 + 0 + 1366 + 768 + + + + Form + + + QWidget { + width:1366px; + height:768px; +} + + + + + 618 + 20 + 200 + 32 + + + + + HelveticaNeue + -1 + + + + false + + + QLabel { + width:200px; + height:44px; + + font-size:16px; + font-family:HelveticaNeue; + color:rgba(255,255,255,1); + line-height:18px; +} + + + baluoteliz + + + Qt::AlignCenter + + + + + + 1024 + 37 + 264 + 32 + + + + false + + + QLabel { + width:264px; + height:32px; + + image: url(:/uiresource/Groupparam.png); + border-radius:4px; + opacity:0.4; + font-size:12px; + font-family:HelveticaNeue; + color:rgba(238,238,238,1); + line-height:18px; +} + + + SD-RTN: 10000ms. Video: 15fps 640x480 + + + Qt::AlignCenter + + + + + + 1296 + 558 + 50 + 50 + + + + false + + + QCheckBox::indicator{ + width:50px; + height:50px; +} + +QCheckBox:indicator:unchecked:!hover { + image: url(:/uiresource/icon-camera.png); +} +QCheckBox:indicator:unchecked:hover { + image: url(:/uiresource/icon-camera on.png); +} + +QCheckBox:indicator:checked:!hover { + image: url(:/uiresource/icon-camera off.png); +} +QCheckBox:indicator:checked:hover { + image: url(:/uiresource/icon-camera off.png); +} + + + RadioButton + + + true + + + false + + + + + + 1296 + 628 + 50 + 50 + + + + false + + + QCheckBox::indicator{ + width:50px; + height:50px; +} + +QCheckBox:indicator:unchecked:!hover { + image: url(:/uiresource/icon-micorophone.png); +} +QCheckBox:indicator:unchecked:hover { + image: url(:/uiresource/icon-micorophone on.png); +} + +QCheckBox:indicator:checked:!hover { + image: url(:/uiresource/icon-micorophone off.png); +} +QCheckBox:indicator:checked:hover { + image: url(:/uiresource/icon-micorophone off.png); +} + + + RadioButton + + + true + + + false + + + + + + 30 + 574 + 200 + 32 + + + + width:200px; +height:32px; +image: url(:/uiresource/count.png); +border-radius:4px; +opacity:0.4; +font-size:14px; +font-family:HelveticaNeue; +color:#ffffff; +line-height:16px; + + + Total 7 Person + + + Qt::AlignCenter + + + + + + 35 + 214 + 111 + 20 + + + + width:83px; +height:20px; +image: url(:/uiresource/remoteuid.png); +border-radius:10px; +font-size:12px; +font-family:HelveticaNeue; +color:#ffffff; +line-height:14px; + + + uid:r1 + + + + + + 40 + 534 + 111 + 20 + + + + width:83px; +height:20px; +image: url(:/uiresource/remoteuid.png); +border-radius:10px; +font-size:12px; +font-family:HelveticaNeue; +color:#ffffff; +line-height:14px; + + + uid:r3 + + + + + + 40 + 374 + 111 + 20 + + + + width:83px; +height:20px; +image: url(:/uiresource/remoteuid.png); +border-radius:10px; +font-size:12px; +font-family:HelveticaNeue; +color:#ffffff; +line-height:14px; + + + uid:r2 + + + + + + 1296 + 698 + 50 + 50 + + + + QPushButton:!hover{ + border-image: url(:/uiresource/icon-hang up hover.png); +} +QPushButton:hover{ + border-image: url(:/uiresource/icon-hang up.png); +} + + + + + + + + + diff --git a/Group-Video/OpenVideoCall-Windows/inroom.cpp b/Group-Video/OpenVideoCall-Windows/inroom.cpp new file mode 100644 index 00000000..5af4ac17 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/inroom.cpp @@ -0,0 +1,388 @@ +#include "agoraobject.h" +#include "inroom.h" +#include "ui_inroom.h" +#include "agorawindowmanager.h" + +#ifdef Q_OS_WIN32 +#include +#endif + +InRoom::InRoom(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::InRoom) +{ + ui->setupUi(this); + this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint + | Qt::WindowMinMaxButtonsHint ); + + CAgoraObject* pObject = CAgoraObject::getInstance(); + AgoraWindowManager::getInstance()->insertItem(qWndType_InRoom,this); + + connect(pObject,SIGNAL(sender_videoStopped()), + this,SLOT(receive_videoStopped())); + connect(pObject,SIGNAL(sender_joinedChannelSuccess(const QString&,unsigned int ,int)), + this,SLOT(receive_joinedChannelSuccess(const QString&,unsigned int,int))); + connect(pObject,SIGNAL(sender_userJoined(unsigned int,int)), + this,SLOT(receive_userJoined(unsigned int,int))); + connect(pObject,SIGNAL(sender_userOffline(unsigned int,USER_OFFLINE_REASON_TYPE)), + this,SLOT(receive_userOffline(unsigned int,USER_OFFLINE_REASON_TYPE))); + connect(pObject,SIGNAL(sender_firstLocalVideoFrame(int,int,int)), + this,SLOT(receive_firstLocalVideoFrame(int,int,int))); + connect(pObject,SIGNAL(sender_firstRemoteVideoDecoded(unsigned int,int,int,int)), + this,SLOT(receive_firstRemoteVideoDecoded(unsigned int,int,int,int))); + connect(pObject,SIGNAL(sender_firstRemoteVideoFrameDrawn(unsigned int,int,int,int)), + this,SLOT(receive_firstRemoteVideoFrameDrawn(unsigned int,int,int,int))); + connect(pObject,SIGNAL(sender_localVideoStats(LocalVideoStats)), + this,SLOT(receive_localVideoStats(LocalVideoStats))); + connect(pObject,SIGNAL(sender_remoteVideoStats(RemoteVideoStats)), + this,SLOT(receive_remoteVideoStats(RemoteVideoStats))); + connect(pObject,SIGNAL(sender_rtcStats(RtcStats)), + this,SLOT(receive_rtcStats(RtcStats))); + + ui->widget_l->lower(); + ui->widget_r1->raise(); + ui->widget_r2->raise(); + ui->widget_r3->raise(); + ui->widget_r1->setWindowOpacity(1);//opaque. + ui->widget_r2->setWindowOpacity(1); + ui->widget_r3->setWindowOpacity(1); + + ui->widget_l->installEventFilter(this); + ui->widget_r1->installEventFilter(this); + ui->widget_r2->installEventFilter(this); + ui->widget_r3->installEventFilter(this); + + m_timer_fps = new QTimer(this); + connect(m_timer_fps,SIGNAL(timeout()),this,SLOT(receive_timer_pfs())); +} + +InRoom::~InRoom() +{ + delete ui; +} + +void InRoom::mousePressEvent(QMouseEvent *e) +{ + if(e->button() == Qt::LeftButton) { + m_mousePosition = e->pos(); + if(m_mousePosition.x() < lnTitleWidth && + m_mousePosition.y() < lnTitleHeight) + m_bMousePressed = true; + } + + QApplication::sendEvent(m_uper.get(),e); +} + +void InRoom::mouseMoveEvent(QMouseEvent *e) +{ + if(m_bMousePressed == true) { + QPoint movePos = e->globalPos() - m_mousePosition; + move(movePos); + e->accept(); + } + + + QApplication::sendEvent(m_uper.get(),e); +} + +void InRoom::mouseReleaseEvent(QMouseEvent *e) +{ + m_bMousePressed = false; + + QApplication::sendEvent(m_uper.get(),e); +} + +void InRoom::focusInEvent(QFocusEvent *event) +{ + QApplication::sendEvent(m_uper.get(),event); +} + +void InRoom::focusOutEvent(QFocusEvent *event) +{ + QApplication::sendEvent(m_uper.get(),event); +} + +void InRoom::joinchannel(const QString& qsChannelId,const QString& qsChannelKey,uint uid) +{ + this->show(); + + CAgoraObject::getInstance()->joinChannel((qsChannelKey.length() > 0 ? qsChannelKey:NULL),qsChannelId,uid); + + m_uper.reset(new EnterRoom); + m_uper->joinchannel(qsChannelId,uid); +} + +void InRoom::leavechannel() +{ + m_timer_fps->stop(); + { + std::lock_guard autoLock(m_vsMutex); + m_qivs.clear(); + delete m_timer_fps; + m_bigUid = 0; + m_uid = 0; + } + + CAgoraObject::getInstance()->leaveChannel(); + this->hide(); + + QMainWindow* pLastWnd = AgoraWindowManager::getInstance()->getQWnd(qWndType_OpenVideoCall); + pLastWnd->show(); +} + +void InRoom::receive_videoStopped() +{ +} + +void InRoom::receive_joinedChannelSuccess(const QString &qsChannel, unsigned int uid, int elapsed) +{ + { + std::lock_guard autoLock(m_vsMutex); + m_uid = uid; + if(!m_qivs.contains(uid)) { + m_qivs[uid] = Video_Stats(uid); + } + } + + adjustPos(); + + QString qsChannelInfo; + m_qsChannel = qsChannel; + qsChannelInfo.sprintf("%s %u",qsChannel.toStdString().c_str(),uid); + m_uper->setChannelName(qsChannelInfo); + m_bigUid = uid; + m_timer_fps->start(2000); +} + +void InRoom::receive_userJoined(uid_t uid, int elapsed) +{ + { + std::lock_guard autoLock(m_vsMutex); + if(!m_qivs.contains(uid)) { + m_qivs[uid] = Video_Stats(uid); + } + } + + adjustPos(); +} + +void InRoom::receive_userOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) +{ + { + std::lock_guard autoLock(m_vsMutex); + if(m_qivs.contains(uid)) { + auto it = m_qivs.find(uid); + m_qivs.erase(it); + } + } + + adjustPos(); +} + +void InRoom::receive_firstLocalVideoFrame(int width, int height, int elapsed) +{ + +} + +void InRoom::receive_firstRemoteVideoDecoded(uid_t uid, int width, int height, int elapsed) +{ + +} + +void InRoom::receive_firstRemoteVideoFrameDrawn(uid_t uid, int width, int height, int elapsed) +{ + +} + +void InRoom::receive_localVideoStats(const LocalVideoStats &stats) +{ + { + std::lock_guard autoLock(m_vsMutex); + if(m_qivs.contains(m_uid)) { + m_qivs[m_uid].nWidth = stats.encodedFrameWidth; + m_qivs[m_uid].nHeight = stats.encodedFrameHeight; + m_qivs[m_uid].nFps = stats.sentFrameRate; + m_qivs[m_uid].nBitrate = stats.sentBitrate; + } + } +} + +void InRoom::receive_remoteVideoStats(const RemoteVideoStats &stats) +{ + { + std::lock_guard autoLock(m_vsMutex); + if(m_qivs.contains(stats.uid)) { + m_qivs[stats.uid].nLastmileDelay = stats.delay; + m_qivs[stats.uid].nWidth = stats.width; + m_qivs[stats.uid].nHeight = stats.height; + m_qivs[stats.uid].nFps = stats.rendererOutputFrameRate; + m_qivs[stats.uid].nBitrate = stats.receivedBitrate; + } + } +} + +void InRoom::receive_rtcStats(const RtcStats &stats) +{ + m_nlastmileDelay = stats.lastmileDelay; + + std::lock_guard autoLock(m_vsMutex); + if(m_qivs.contains(m_uid)) + m_qivs[m_uid].nLastmileDelay = stats.lastmileDelay; +} + +void InRoom::receive_timer_pfs() +{ + std::lock_guard autoLock(m_vsMutex); + if(m_qivs.contains(m_bigUid)) { + QString qsFps; + auto it = m_qivs.value(m_bigUid); + qsFps.sprintf("SD-RTN: %dms. Video: %dfps %dx%d",it.nLastmileDelay,it.nFps,it.nWidth,it.nHeight); + m_uper->setParam(qsFps); + } +} + +void InRoom::adjustPos() +{ + ui->widget_l->setVisible(false); + ui->widget_r1->setVisible(false); + ui->widget_r2->setVisible(false); + ui->widget_r3->setVisible(false); + + std::lock_guard autoLock(m_vsMutex); + auto it = m_qivs.begin(); + int nIndex = 0; + while(m_qivs.end() != it) { + if(it->uid == m_uid) { + m_bigUid == m_uid; + it->pWidget = ui->widget_l; + it->nIndex = 0; + CAgoraObject::getInstance()->LocalVideoPreview((HWND)(it->pWidget->winId()), + TRUE, + (it->uid == m_bigUid) ? RENDER_MODE_FIT : RENDER_MODE_HIDDEN); + ui->widget_l->setVisible(true); + ui->widget_l->setGeometry(0,0,1366,768); + ui->widget_l->lower(); + QString qsChannelInfo; + qsChannelInfo.sprintf("%s %u",m_qsChannel.toStdString().c_str(),m_uid); + m_uper->setChannelName(qsChannelInfo); + } + else { + nIndex++; + if(nIndex == 1) { + it->pWidget = ui->widget_r1; + it->nIndex = 1; + CAgoraObject::getInstance()->RemoteVideoRender(it->uid, + (HWND)(it->pWidget->winId()), + (it->uid == m_bigUid) ? RENDER_MODE_FIT:RENDER_MODE_HIDDEN); + m_uper->setR1(it->uid); + ui->widget_r1->setVisible(true); + ui->widget_r1->setGeometry(30,94,200,150); + ui->widget_r1->raise(); + } + + if(nIndex == 2) { + it->pWidget = ui->widget_r2; + it->nIndex = 2; + CAgoraObject::getInstance()->RemoteVideoRender(it->uid, + (HWND)(it->pWidget->winId()), + (it->uid == m_bigUid) ? RENDER_MODE_FIT:RENDER_MODE_HIDDEN); + m_uper->setR2(it->uid); + ui->widget_r2->setVisible(true); + ui->widget_r2->setGeometry(30,254,200,150); + ui->widget_r2->raise(); + } + + if(nIndex == 3) { + it->pWidget = ui->widget_r3; + it->nIndex = 3; + CAgoraObject::getInstance()->RemoteVideoRender(it->uid, + (HWND)(it->pWidget->winId()), + (it->uid == m_bigUid) ? RENDER_MODE_FIT:RENDER_MODE_HIDDEN); + m_uper->setR3(it->uid); + ui->widget_r3->setVisible(true); + ui->widget_r3->setGeometry(30,414,200,150); + ui->widget_r3->raise(); + } + } + it++; + } + + m_uper->setAllRAtt(nIndex); +} + +bool InRoom::eventFilter(QObject *watched,QEvent *event) +{ + bool bFind = false; + int nIndex = 0; + Video_Stats vsr,vsbig; + if(watched==ui->widget_r1 && event->type() == QEvent::MouseButtonDblClick) { + qDebug("DBClick r1"); + std::lock_guard autoLock(m_vsMutex); + uid_t uid = m_uper->getR1(); + if(m_qivs.contains(uid) && m_qivs.contains(m_bigUid)) { + vsr = m_qivs[uid]; + vsbig = m_qivs[m_bigUid]; + bFind = ( vsr.uid == m_bigUid ) ? false : true; + nIndex = vsr.nIndex; + } + } + else if(watched == ui->widget_r2 && event->type() == QEvent::MouseButtonDblClick) { + qDebug("DBClick r2"); + std::lock_guard autoLock(m_vsMutex); + uid_t uid = m_uper->getR2(); + if(m_qivs.contains(uid) && m_qivs.contains(m_bigUid)) { + vsr = m_qivs[uid]; + vsbig = m_qivs[m_bigUid]; + bFind = (vsr.uid == m_bigUid) ? false : true; + nIndex = vsr.nIndex; + } + } + else if(watched == ui->widget_r3 && event->type() == QEvent::MouseButtonDblClick) { + qDebug("DBClick r3"); + std::lock_guard autoLock(m_vsMutex); + uid_t uid = m_uper->getR3(); + if(m_qivs.contains(uid) && m_qivs.contains(m_bigUid)) { + vsr = m_qivs[uid]; + vsbig = m_qivs[m_bigUid]; + bFind = (vsr.uid == m_bigUid) ? false : true; + nIndex = vsr.nIndex; + } + } + + else if(watched == ui->widget_l && event->type() == QEvent::MouseButtonDblClick) { + qDebug("DBClick local"); + std::lock_guard autoLock(m_vsMutex); + uid_t uid = m_uid; + if(m_qivs.contains(uid) && m_qivs.contains(m_bigUid)) { + vsr = m_qivs[uid]; + vsbig = m_qivs[m_bigUid]; + bFind = (vsr.uid == m_bigUid) ? false : true; + nIndex = vsr.nIndex; + } + } + + if(bFind) { + std::lock_guard autolock(m_vsMutex); + QRect qrr,qrbig; + if(vsr.pWidget) + qrr = vsr.pWidget->geometry(); + if(vsbig.pWidget) + qrbig = vsbig.pWidget->geometry(); + + vsr.pWidget->setGeometry(qrbig); + vsbig.pWidget->setGeometry(qrr); + vsr.pWidget->lower(); + vsbig.pWidget->raise(); + m_qivs[vsr.uid].nIndex = 0; + m_qivs[vsbig.uid].nIndex = nIndex; + + QString qsSrc,qsDest; + qsSrc.sprintf("%s %u",m_qsChannel.toStdString().c_str(),vsr.uid); + qsDest.sprintf(" uid:%u",vsbig.uid); + m_uper->switchUidText(qsSrc,qsDest,nIndex); + + m_bigUid = vsr.uid; + } + + return QWidget::eventFilter(watched,event); +} diff --git a/Group-Video/OpenVideoCall-Windows/inroom.h b/Group-Video/OpenVideoCall-Windows/inroom.h new file mode 100644 index 00000000..96b0eca5 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/inroom.h @@ -0,0 +1,109 @@ +#ifndef INROOM_H +#define INROOM_H + +#include +#include +#include +#include "enterroom.h" +#include +#include + +#include +using namespace agora::rtc; + +namespace Ui { +class InRoom; +} + +typedef struct eTagVideoStats { + eTagVideoStats(){;} + eTagVideoStats(unsigned int ui,int nlastmiledelay = 0,int nwidth = 0,int nheight = 0,int nfps = 0,int nbitrate = 0,QWidget *pwidget = Q_NULLPTR,int nindex = 0): + uid(ui),nLastmileDelay(nlastmiledelay),nWidth(nwidth),nHeight(nheight),nFps(nfps),nBitrate(nbitrate),pWidget(pwidget),nIndex(nindex){;} + eTagVideoStats(const eTagVideoStats& vss) { + *this = vss; + } + eTagVideoStats& operator=(const eTagVideoStats& vss) { + if(this != &vss) { + uid = vss.uid; + nLastmileDelay = vss.nLastmileDelay; + nWidth = vss.nWidth; + nHeight = vss.nHeight; + nFps = vss.nFps; + nBitrate = vss.nBitrate; + pWidget = vss.pWidget; + nIndex = vss.nIndex; + } + + return *this; + } + + unsigned int uid; + int nLastmileDelay; + int nWidth; + int nHeight; + int nFps; + int nBitrate; + QWidget* pWidget; + int nIndex; +}Video_Stats,*PVideo_Stats,*LPVideoStats; +typedef QMap qIVS; + +class InRoom : public QMainWindow +{ + Q_OBJECT + +public: + explicit InRoom(QWidget *parent = 0); + ~InRoom(); + +private: + Ui::InRoom *ui; + +protected: + virtual void mousePressEvent(QMouseEvent *e); + virtual void mouseMoveEvent(QMouseEvent *e); + virtual void mouseReleaseEvent(QMouseEvent *e); + + virtual void focusInEvent(QFocusEvent *event); + virtual void focusOutEvent(QFocusEvent *event); + +public slots: + void joinchannel(const QString& qsChannelId,const QString& qsChannelKey,uint uid); + void leavechannel(); + + void receive_videoStopped(); + void receive_joinedChannelSuccess(const QString &qsChannel, unsigned int uid, int elapsed); + void receive_userJoined(unsigned int uid, int elapsed); + void receive_userOffline(unsigned int uid, USER_OFFLINE_REASON_TYPE reason); + void receive_firstLocalVideoFrame(int width, int height, int elapsed); + void receive_firstRemoteVideoDecoded(unsigned int uid, int width, int height, int elapsed); + void receive_firstRemoteVideoFrameDrawn(unsigned int uid, int width, int height, int elapsed); + void receive_localVideoStats(const LocalVideoStats &stats); + void receive_remoteVideoStats(const RemoteVideoStats &stats); + void receive_rtcStats(const RtcStats &stats); + + void receive_timer_pfs(); + + bool eventFilter(QObject *watched,QEvent *event); + +private slots: + +private: + void adjustPos(); + +private: + const int lnTitleWidth = 1366; + const int lnTitleHeight = 30; + QPoint m_mousePosition; + bool m_bMousePressed; + std::unique_ptr m_uper; + std::mutex m_vsMutex; + qIVS m_qivs; + int m_nlastmileDelay; + QTimer *m_timer_fps; + uid_t m_uid; + uid_t m_bigUid; + QString m_qsChannel; +}; + +#endif // INROOM_H diff --git a/Group-Video/OpenVideoCall-Windows/inroom.ui b/Group-Video/OpenVideoCall-Windows/inroom.ui new file mode 100644 index 00000000..0eec14da --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/inroom.ui @@ -0,0 +1,98 @@ + + + InRoom + + + + 0 + 0 + 1366 + 768 + + + + MainWindow + + + + background-color:#999999; + + + + + 30 + 94 + 200 + 150 + + + + image: url(:/uiresource/allmute remote.png); +border-color: #D8D8D8; +border-size:1px; +border-radius:2px; + + + + + + 30 + 254 + 200 + 150 + + + + image: url(:/uiresource/allmute remote.png); +border-color: #D8D8D8; +border-size:1px; +border-radius:2px; + + + + + + 30 + 414 + 200 + 150 + + + + image: url(:/uiresource/allmute remote.png); +border-color: #D8D8D8; +border-size:1px; +border-radius:2px; + + + + + + 0 + 0 + 1366 + 768 + + + + + + 543 + 228 + 280 + 280 + + + + image: url(:/uiresource/allmute.png); + + + + + + + + + + + diff --git a/Group-Video/OpenVideoCall-Windows/inroomdig.cpp b/Group-Video/OpenVideoCall-Windows/inroomdig.cpp new file mode 100644 index 00000000..ef81d699 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/inroomdig.cpp @@ -0,0 +1,61 @@ +#include "inroomdig.h" +#include "ui_inroomdig.h" +#include "agoraobject.h" +#include "qquickwidget.h" +#include "QHBoxLayout" +#include "QStackedLayout" + +InRoomDig::InRoomDig(QWidget *parent) : + QDialog(parent), + ui(new Ui::InRoomDig) +{ + ui->setupUi(this); + this->setWindowFlags(Qt::FramelessWindowHint | Qt::Dialog); + //this->setAttribute(Qt::WA_TranslucentBackground); + initWindow(); +} + +InRoomDig::~InRoomDig() +{ + delete ui; +} + +void InRoomDig::initWindow() +{ + QString strDir = QCoreApplication::applicationDirPath(); + strDir.append("\\AgoraSDK.log"); + CAgoraObject::getInstance(this)->setLogPath(strDir); + + CAgoraObject::getInstance()->enableAudio(true); + CAgoraObject::getInstance()->enableVideo(true); + CAgoraObject::getInstance()->EnableWebSdkInteroperability(true); + CAgoraObject::getInstance()->SetChannelProfile(CHANNEL_PROFILE_COMMUNICATION); + CAgoraObject::getInstance()->joinChannel("","233",0); + + QHBoxLayout *main_layout = new QHBoxLayout(); + QStackedLayout *stacked_layout = new QStackedLayout(); + stacked_layout->setMargin(0); + stacked_layout->setStackingMode(QStackedLayout::StackAll); + + QLabel* player_status_ = new QLabel("test", this); + player_status_->setGeometry(618,20,130,32); + player_status_->move(618,20); + player_status_->resize(130,32); + QPalette pe; + pe.setColor(QPalette::WindowText, Qt::red); + player_status_->setPalette(pe); + player_status_->setAlignment(Qt::AlignCenter|Qt::AlignCenter); + + stacked_layout->addWidget(player_status_); + main_layout->addLayout(stacked_layout); + setLayout(main_layout); + player_status_->raise(); + + QWidget* player_video_ = new QWidget(); + player_video_->setGeometry(0,0,1366,768); + player_video_->setLayout(main_layout); + // this->setCentralWidget(player_video_); + player_video_->show(); + + CAgoraObject::getInstance()->LocalVideoPreview((HWND)(player_video_->winId()),TRUE); +} diff --git a/Group-Video/OpenVideoCall-Windows/inroomdig.h b/Group-Video/OpenVideoCall-Windows/inroomdig.h new file mode 100644 index 00000000..e54ab5c0 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/inroomdig.h @@ -0,0 +1,26 @@ +#ifndef INROOMDIG_H +#define INROOMDIG_H + +#include +#include + +namespace Ui { +class InRoomDig; +} + +class InRoomDig : public QDialog +{ + Q_OBJECT + +public: + explicit InRoomDig(QWidget *parent = 0); + ~InRoomDig(); + + void initWindow(); + +private: + Ui::InRoomDig *ui; + QLabel* m_labText; +}; + +#endif // INROOMDIG_H diff --git a/Group-Video/OpenVideoCall-Windows/inroomdig.ui b/Group-Video/OpenVideoCall-Windows/inroomdig.ui new file mode 100644 index 00000000..6c56e0b7 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/inroomdig.ui @@ -0,0 +1,22 @@ + + + InRoomDig + + + + 0 + 0 + 1366 + 768 + + + + Dialog + + + + + + + + diff --git a/Group-Video/OpenVideoCall-Windows/main.cpp b/Group-Video/OpenVideoCall-Windows/main.cpp new file mode 100644 index 00000000..59af23a2 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/main.cpp @@ -0,0 +1,32 @@ +#include "openvideocall.h" +#include "avdevice.h" +#include "nettesting.h" +#include "nettestresult.h" +#include "inroom.h" +#include "enterroom.h" +#include +#include +using namespace agora::rtc; + +Q_DECLARE_METATYPE(USER_OFFLINE_REASON_TYPE) +Q_DECLARE_METATYPE(LocalVideoStats) +Q_DECLARE_METATYPE(RemoteVideoStats) +Q_DECLARE_METATYPE(RtcStats) +Q_DECLARE_METATYPE(LastmileProbeResult) + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + a.setWindowIcon(QIcon("openvideocall.ico")); + + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + + OpenVideoCall w; + w.show(); + + return a.exec(); +} diff --git a/Group-Video/OpenVideoCall-Windows/nettestdetail.cpp b/Group-Video/OpenVideoCall-Windows/nettestdetail.cpp new file mode 100644 index 00000000..aff698e4 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/nettestdetail.cpp @@ -0,0 +1,80 @@ +#include "nettestdetail.h" +#include "ui_nettestdetail.h" +#include "agorawindowmanager.h" +#include + +NetTestDetail::NetTestDetail(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::NetTestDetail) +{ + ui->setupUi(this); + this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint); + this->setAttribute(Qt::WA_TranslucentBackground); + + AgoraWindowManager::getInstance()->insertItem(qWndType_NetTestDetail,this); +} + +NetTestDetail::~NetTestDetail() +{ + delete ui; +} + +void NetTestDetail::receiver_network_detail(int quality,const LastmileProbeResult& lr) +{ + qDebug(__FUNCTION__); + + ui->lb_rtt_up->setText(QString::number(lr.rtt)); + ui->lb_lost_up->setText(QString::number(lr.uplinkReport.packetLossRate)); + ui->lb_lost_down->setText(QString::number(lr.downlinkReport.packetLossRate)); + ui->lb_bandwidth_up->setText(QString::number(lr.uplinkReport.availableBandwidth)); + ui->lb_bandwidth_down->setText(QString::number(lr.downlinkReport.availableBandwidth)); +} + +void NetTestDetail::mousePressEvent(QMouseEvent *e) +{ + if(e->button() == Qt::LeftButton) { + m_mousePosition = e->pos(); + if(m_mousePosition.x() < lnTitleWidth && + m_mousePosition.x() >= lnGapWidth && + m_mousePosition.y() >= lnGapHeight && + m_mousePosition.y() < lnTitleHeight) + m_bMousePressed = true; + } +} + +void NetTestDetail::mouseMoveEvent(QMouseEvent *e) +{ + if(m_bMousePressed == true) { + QPoint movePos = e->globalPos() - m_mousePosition; + move(movePos); + e->accept(); + } +} + +void NetTestDetail::mouseReleaseEvent(QMouseEvent *e) +{ + m_bMousePressed = false; +} + +void NetTestDetail::on_btn_back_clicked() +{ + this->hide(); + QMainWindow* pWnd = AgoraWindowManager::getInstance()->getQWnd(qWndType_OpenVideoCall); + if(pWnd) + pWnd->show(); +} + +void NetTestDetail::on_btn_min_clicked() +{ + this->showMinimized(); +} + +void NetTestDetail::on_btn_close_clicked() +{ + on_btn_back_clicked(); +} + +void NetTestDetail::on_btn_ok_clicked() +{ + on_btn_back_clicked(); +} diff --git a/Group-Video/OpenVideoCall-Windows/nettestdetail.h b/Group-Video/OpenVideoCall-Windows/nettestdetail.h new file mode 100644 index 00000000..805ba88a --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/nettestdetail.h @@ -0,0 +1,51 @@ +#ifndef NETTESTDETAIL_H +#define NETTESTDETAIL_H + +#include +#include +#include +using namespace agora::rtc; + +namespace Ui { +class NetTestDetail; +} + +class NetTestDetail : public QMainWindow +{ + Q_OBJECT + +public: + explicit NetTestDetail(QWidget *parent = 0); + ~NetTestDetail(); + +protected slots: + void receiver_network_detail(int quality,const LastmileProbeResult& lr); + +protected: + virtual void mousePressEvent(QMouseEvent *e); + virtual void mouseMoveEvent(QMouseEvent *e); + virtual void mouseReleaseEvent(QMouseEvent *e); + +private slots: + void on_btn_back_clicked(); + + void on_btn_min_clicked(); + + void on_btn_close_clicked(); + + void on_btn_ok_clicked(); + +private: + const int lnGapWidth = 18; + const int lnGapHeight = 12; + const int lnTitleWidth = 718; + const int lnTitleHeight = 30; + QPoint m_mousePosition; + bool m_bMousePressed; + + +private: + Ui::NetTestDetail *ui; +}; + +#endif // NETTESTDETAIL_H diff --git a/Group-Video/OpenVideoCall-Windows/nettestdetail.ui b/Group-Video/OpenVideoCall-Windows/nettestdetail.ui new file mode 100644 index 00000000..1591de06 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/nettestdetail.ui @@ -0,0 +1,283 @@ + + + NetTestDetail + + + + 0 + 0 + 786 + 536 + + + + MainWindow + + + + image: url(:/uiresource/OVC-win-netdetail.png); + + + + + 418 + 25 + 36 + 36 + + + + QPushButton:!hover{ +border-image: url(:/uiresource/icon-back.png); +image: url(:/uiresource/icon-back.png); +} + +QPushButton:hover:!pressed{ +border-image: url(:/uiresource/icon-back hover.png); +image: url(:/uiresource/icon-back hover.png); +} + +QPushButton:!hover:pressed{ +border-image: url(:/uiresource/icon-back.png); +image: url(:/uiresource/icon-back.png); +} + + + + + + + + + 698 + 34 + 18 + 18 + + + + QPushButton:!hover{ + border-image: url(:/uiresource/icon-min default.png); + image: url(:/uiresource/icon-min default.png); +} + +QPushButton:hover:!pressed{ + border-image: url(:/uiresource/icon-min hover.png); + image: url(:/uiresource/icon-min hover.png); +} + +QPushButton:!hover:pressed{ + border-image: url(:/uiresource/icon-min default.png); + image: url(:/uiresource/icon-min default.png); +} + + + + + + + + + 726 + 34 + 18 + 18 + + + + QPushButton:!hover{ + border-image: url(:/uiresource/icon-close default.png); + image: url(:/uiresource/icon-close default.png); +} + +QPushButton:hover:!pressed{ + border-image: url(:/uiresource/icon-close hover.png); + image: url(:/uiresource/icon-close hover.png); +} + +QPushButton:!hover:pressed{ + border-image: url(:/uiresource/icon-close default.png); + image: url(:/uiresource/icon-close default.png); +} + + + + + + + + + 528 + 87 + 64 + 20 + + + + font-size:14px; +font-family:PingFangSC-Regular,PingFangSC; +font-weight:400; +color:rgba(102,102,102,1); +line-height:20px; +image: url(:/uiresource/edit1.png); + + + TextLabel + + + + + + 676 + 87 + 63 + 20 + + + + font-size:14px; +font-family:PingFangSC-Regular,PingFangSC; +font-weight:400; +color:rgba(102,102,102,1); +line-height:20px; +image: url(:/uiresource/edit1.png); + + + + + + + + + 676 + 133 + 63 + 20 + + + + font-size:14px; +font-family:PingFangSC-Regular,PingFangSC; +font-weight:400; +color:rgba(102,102,102,1); +line-height:20px; +image: url(:/uiresource/edit1.png); + + + TextLabel + + + + + + 528 + 133 + 64 + 20 + + + + font-size:14px; +font-family:PingFangSC-Regular,PingFangSC; +font-weight:400; +color:rgba(102,102,102,1); +line-height:20px; +image: url(:/uiresource/edit1.png); + + + TextLabel + + + + + + 528 + 179 + 119 + 20 + + + + font-size:14px; +font-family:PingFangSC-Regular,PingFangSC; +font-weight:400; +color:rgba(102,102,102,1); +line-height:20px; +border-image: url(:/uiresource/edit4.png); +image: url(:/uiresource/edit4.png); + + + TextLabel + + + + + + 676 + 179 + 63 + 20 + + + + font-size:14px; +font-family:PingFangSC-Regular,PingFangSC; +font-weight:400; +color:rgba(102,102,102,1); +line-height:20px; +image: url(:/uiresource/edit1.png); + + + TextLabel + + + + + + 418 + 437 + 325 + 44 + + + + QPushButton:!hover { +font-size:17px; +font-family:HelveticaNeue; +color:rgba(0,106,216,1); +line-height:20px; +background:rgba(255,255,255,1); +border-radius:2px; +border:1px solid rgba(204,204,204,1); +image: url(:/uiresource/edit1.png); +} +QPushButton:hover:pressed { +font-size:17px; +font-family:HelveticaNeue; +color:rgba(0,106,216,1); +line-height:20px; +background:rgba(255,255,255,1); +border-radius:2px; +border:1px solid rgba(204,204,204,1); +image: url(:/uiresource/edit1.png); +} +QPushButton:hover:!pressed { +font-size:17px; +font-family:HelveticaNeue; +color:rgba(255,255,255,1); +line-height:20px; +background:rgba(0,106,216,1); +border-radius:2px; +border:1px solid rgba(204,204,204,1); +image: url(:/uiresource/edit2.png); +} + + + OK + + + + + + + diff --git a/Group-Video/OpenVideoCall-Windows/nettesting.cpp b/Group-Video/OpenVideoCall-Windows/nettesting.cpp new file mode 100644 index 00000000..b8e60ef2 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/nettesting.cpp @@ -0,0 +1,96 @@ +#include "nettesting.h" +#include "ui_nettesting.h" +#include +#include "agoraobject.h" +#include "agorawindowmanager.h" + +NetTesting::NetTesting(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::NetTesting) +{ + ui->setupUi(this); + + this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint); + this->setAttribute(Qt::WA_TranslucentBackground); + + CAgoraObject* pInstance = CAgoraObject::getInstance(); + connect(pInstance,SIGNAL(sender_lastmileQuality(int)),this,SLOT(receive_lastmileQuality(int))); + connect(pInstance,SIGNAL(sender_lastmileProbeResult(const LastmileProbeResult&)),this,SLOT(receive_lastmileProbeResult(LastmileProbeResult))); + + CAgoraObject::getInstance()->startLastMileProbeTest(true); + QMovie* pMovie = new QMovie("uiresource\\loading.gif"); + ui->lb_status->setMovie(pMovie); + pMovie->start(); + + AgoraWindowManager::getInstance()->insertItem(qWndType_NetTesting,this); +} + +NetTesting::~NetTesting() +{ + delete ui; +} + +void NetTesting::on_btn_back_clicked() +{ + this->hide(); + CAgoraObject::getInstance()->startLastMileProbeTest(false); + QMainWindow* pWnd = AgoraWindowManager::getInstance()->getQWnd(qWndType_OpenVideoCall); + if(pWnd) + pWnd->show(); +} + +void NetTesting::on_btn_min_clicked() +{ + this->showMinimized(); +} + +void NetTesting::on_btn_close_clicked() +{ + on_btn_back_clicked(); +} + +void NetTesting::receive_lastmileQuality(int quality) +{ + m_nQuality = quality; +} + +void NetTesting::receive_lastmileProbeResult(const LastmileProbeResult &result) +{ + if(m_nQuality >=1 && m_nQuality <= 6) + CAgoraObject::getInstance()->startLastMileProbeTest(false); + this->hide(); + m_lp = result; + + m_upNtr.reset(new NetTestResult()); + connect(this,SIGNAL(sender_network_result(int,LastmileProbeResult)), + m_upNtr.get(),SLOT(receiver_network_result(int,LastmileProbeResult))); + emit sender_network_result(m_nQuality,m_lp); + m_upNtr->show(); +} + +void NetTesting::mousePressEvent(QMouseEvent *e) +{ + if(e->button() == Qt::LeftButton) { + m_mousePosition = e->pos(); + if(m_mousePosition.x() < lnTitleWidth && + m_mousePosition.x() >= lnGapWidth && + m_mousePosition.y() >= lnGapHeight && + m_mousePosition.y() < lnTitleHeight) + m_bMousePressed = true; + } +} + +void NetTesting::mouseMoveEvent(QMouseEvent *e) +{ + if(m_bMousePressed == true) { + QPoint movePos = e->globalPos() - m_mousePosition; + move(movePos); + e->accept(); + } +} + +void NetTesting::mouseReleaseEvent(QMouseEvent *e) +{ + m_bMousePressed = false; +} + diff --git a/Group-Video/OpenVideoCall-Windows/nettesting.h b/Group-Video/OpenVideoCall-Windows/nettesting.h new file mode 100644 index 00000000..966b187a --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/nettesting.h @@ -0,0 +1,55 @@ +#ifndef NETTESTING_H +#define NETTESTING_H + +#include +#include +#include "nettestresult.h" +#include +#include +using namespace agora::rtc; + +namespace Ui { +class NetTesting; +} + +class NetTesting : public QMainWindow +{ + Q_OBJECT + +public: + explicit NetTesting(QWidget *parent = 0); + ~NetTesting(); + +signals: + void sender_network_result(int quality,const LastmileProbeResult& lr); + +private slots: + void on_btn_back_clicked(); + void on_btn_min_clicked(); + void on_btn_close_clicked(); + + void receive_lastmileQuality(int quality); + void receive_lastmileProbeResult(const LastmileProbeResult &result); + +protected: + virtual void mousePressEvent(QMouseEvent *e); + virtual void mouseMoveEvent(QMouseEvent *e); + virtual void mouseReleaseEvent(QMouseEvent *e); + +private: + const int lnGapWidth = 18; + const int lnGapHeight = 12; + const int lnTitleWidth = 718; + const int lnTitleHeight = 30; + QPoint m_mousePosition; + bool m_bMousePressed; + + int m_nQuality; + LastmileProbeResult m_lp; + +private: + std::unique_ptr m_upNtr; + Ui::NetTesting *ui; +}; + +#endif // NETTESTING_H diff --git a/Group-Video/OpenVideoCall-Windows/nettesting.ui b/Group-Video/OpenVideoCall-Windows/nettesting.ui new file mode 100644 index 00000000..b1601b29 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/nettesting.ui @@ -0,0 +1,126 @@ + + + NetTesting + + + + 0 + 0 + 786 + 536 + + + + MainWindow + + + + image: url(:/uiresource/OVC-win-nettest.png); + + + + + 418 + 25 + 36 + 36 + + + + QPushButton:!hover { +border-image: url(:/uiresource/icon-back.png); +image: url(:/uiresource/icon-back.png); +} +QPushButton:hover:!pressed { +border-image: url(:/uiresource/icon-back hover.png); +image: url(:/uiresource/icon-back hover.png); +} +QPushButton:hover:pressed { +border-image: url(:/uiresource/icon-back.png); +image: url(:/uiresource/icon-back.png); +} + + + + + + + + + + 698 + 34 + 18 + 18 + + + + QPushButton:!hover{ +border-image: url(:/uiresource/icon-min default.png); +image: url(:/uiresource/icon-min default.png); +} + +QPushButton:hover:!pressed { +border-image: url(:/uiresource/icon-min hover.png); +image: url(:/uiresource/icon-min hover.png); +} + +QPushButton:hover:pressed{ +border-image: url(:/uiresource/icon-min default.png); +image: url(:/uiresource/icon-min default.png); +} + + + + + + + + + 726 + 34 + 18 + 18 + + + + QPushButton:!hover{ +border-image: url(:/uiresource/icon-close default.png); +image: url(:/uiresource/icon-close default.png); +} + +QPushButton:hover:!pressed { +border-image: url(:/uiresource/icon-close hover.png); +image: url(:/uiresource/icon-close hover.png); +} + +QPushButton:hover:pressed{ +border-image: url(:/uiresource/icon-close default.png); +image: url(:/uiresource/icon-close default.png); +} + + + + + + + + + 540 + 190 + 83 + 83 + + + + image: url(:/uiresource/edit5.png); + + + + + + + + + + diff --git a/Group-Video/OpenVideoCall-Windows/nettestresult.cpp b/Group-Video/OpenVideoCall-Windows/nettestresult.cpp new file mode 100644 index 00000000..4626eac6 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/nettestresult.cpp @@ -0,0 +1,113 @@ +#include "nettestresult.h" +#include "ui_nettestresult.h" +#include "agorawindowmanager.h" + +NetTestResult::NetTestResult(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::NetTestResult) +{ + ui->setupUi(this); + + this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint); + this->setAttribute(Qt::WA_TranslucentBackground); + + AgoraWindowManager::getInstance()->insertItem(qWndType_NetTestResult,this); +} + +NetTestResult::~NetTestResult() +{ + delete ui; +} + +void NetTestResult::receiver_network_result(int quality,const LastmileProbeResult& lr) +{ + m_nQuality = quality; + m_lr = lr; + QUALITY_TYPE qt = static_cast(quality); + qDebug("%s(%d)",__FUNCTION__,quality); + switch(qt) { + case QUALITY_TYPE::QUALITY_EXCELLENT: + case QUALITY_TYPE::QUALITY_GOOD: { + ui->lb_status->setStyleSheet("QLabel{image: url(:/uiresource/pic-good.png)}"); + ui->lb_status_desc->setText("Your NetWork is Great"); + } + break; + case QUALITY_TYPE::QUALITY_POOR:{ + ui->lb_status->setStyleSheet("QLabel{image: url(:/uiresource/pic-poor.png)}"); + ui->lb_status_desc->setText("Your NetWork is Poor"); + + } + break; + case QUALITY_TYPE::QUALITY_BAD: + case QUALITY_TYPE::QUALITY_VBAD: + case QUALITY_TYPE::QUALITY_DOWN:{ + ui->lb_status->setStyleSheet("QLabel{image: url(:/uiresource/pic-bad.png)}"); + ui->lb_status_desc->setText("Your NetWork is Bad"); + } + break; + default: { + ui->lb_status->setStyleSheet(""); + ui->lb_status_desc->setText("Your NetWork is Unknown"); + } + break; + }; +} + +void NetTestResult::mousePressEvent(QMouseEvent *e) +{ + if(e->button() == Qt::LeftButton) { + m_mousePosition = e->pos(); + if(m_mousePosition.x() < lnTitleWidth && + m_mousePosition.x() >= lnGapWidth && + m_mousePosition.y() >= lnGapHeight && + m_mousePosition.y() < lnTitleHeight) + m_bMousePressed = true; + } +} + +void NetTestResult::mouseMoveEvent(QMouseEvent *e) +{ + if(m_bMousePressed == true) { + QPoint movePos = e->globalPos() - m_mousePosition; + move(movePos); + e->accept(); + } +} + +void NetTestResult::mouseReleaseEvent(QMouseEvent *e) +{ + m_bMousePressed = false; +} + +void NetTestResult::on_btn_detail_clicked() +{ + this->hide(); + m_upntd.reset(new NetTestDetail()); + connect(this,SIGNAL(sender_network_detail(int,LastmileProbeResult)), + m_upntd.get(),SLOT(receiver_network_detail(int,LastmileProbeResult))); + emit sender_network_detail(m_nQuality,m_lr); + m_upntd->show(); +} + +void NetTestResult::on_btn_ok_clicked() +{ + on_btn_back_clicked(); +} + +void NetTestResult::on_btn_min_clicked() +{ + this->showMinimized(); +} + +void NetTestResult::on_btn_close_clicked() +{ + on_btn_back_clicked(); +} + +void NetTestResult::on_btn_back_clicked() +{ + this->hide(); + QMainWindow* pWnd = AgoraWindowManager::getInstance()->getQWnd(qWndType_OpenVideoCall); + if(pWnd) + pWnd->show(); +} diff --git a/Group-Video/OpenVideoCall-Windows/nettestresult.h b/Group-Video/OpenVideoCall-Windows/nettestresult.h new file mode 100644 index 00000000..fd8c0439 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/nettestresult.h @@ -0,0 +1,61 @@ +#ifndef NETTESTRESULT_H +#define NETTESTRESULT_H + +#include +#include +#include "nettestdetail.h" +#include +#include +using namespace agora::rtc; + +namespace Ui { +class NetTestResult; +} + +class NetTestResult : public QMainWindow +{ + Q_OBJECT + +public: + explicit NetTestResult(QWidget *parent = 0); + ~NetTestResult(); + +signals: + void sender_network_detail(int quality,const LastmileProbeResult& lr); + +protected slots: + void receiver_network_result(int quality,const LastmileProbeResult& lr); + +protected: + virtual void mousePressEvent(QMouseEvent *e); + virtual void mouseMoveEvent(QMouseEvent *e); + virtual void mouseReleaseEvent(QMouseEvent *e); + +private slots: + void on_btn_detail_clicked(); + + void on_btn_ok_clicked(); + + void on_btn_min_clicked(); + + void on_btn_close_clicked(); + + void on_btn_back_clicked(); + +private: + const int lnGapWidth = 18; + const int lnGapHeight = 12; + const int lnTitleWidth = 718; + const int lnTitleHeight = 30; + QPoint m_mousePosition; + bool m_bMousePressed; + +private: + int m_nQuality; + LastmileProbeResult m_lr; + QMainWindow* m_pLastWnd; + Ui::NetTestResult *ui; + std::unique_ptr m_upntd; +}; + +#endif // NETTESTRESULT_H diff --git a/Group-Video/OpenVideoCall-Windows/nettestresult.ui b/Group-Video/OpenVideoCall-Windows/nettestresult.ui new file mode 100644 index 00000000..c4dd7138 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/nettestresult.ui @@ -0,0 +1,241 @@ + + + NetTestResult + + + + 0 + 0 + 786 + 536 + + + + MainWindow + + + + image: url(:/uiresource/OVC-win-netresult.png); + + + + + 418 + 25 + 36 + 36 + + + + QPushButton:!hover{ +border-image: url(:/uiresource/icon-back.png); +image: url(:/uiresource/icon-back.png); +} + +QPushButton:hover:!pressed{ +border-image: url(:/uiresource/icon-back hover.png); +image: url(:/uiresource/icon-back hover.png); +} + +QPushButton:!hover:pressed{ +border-image: url(:/uiresource/icon-back.png); +image: url(:/uiresource/icon-back.png); +} + + + + + + + + + 698 + 34 + 18 + 18 + + + + QPushButton:!hover{ + border-image: url(:/uiresource/icon-min default.png); + image: url(:/uiresource/icon-min default.png); +} + +QPushButton:hover:!pressed{ + border-image: url(:/uiresource/icon-min hover.png); + image: url(:/uiresource/icon-min hover.png); +} + +QPushButton:!hover:pressed{ + border-image: url(:/uiresource/icon-min default.png); + image: url(:/uiresource/icon-min default.png); +} + + + + + + + + + 726 + 34 + 18 + 18 + + + + QPushButton:!hover{ + border-image: url(:/uiresource/icon-close default.png); + image: url(:/uiresource/icon-close default.png); +} + +QPushButton:hover:!pressed{ + border-image: url(:/uiresource/icon-close hover.png); + image: url(:/uiresource/icon-close hover.png); +} + +QPushButton:!hover:pressed{ + border-image: url(:/uiresource/icon-close default.png); + image: url(:/uiresource/icon-close default.png); +} + + + + + + + + + 531 + 157 + 100 + 100 + + + + image: url(:/uiresource/pic-good.png); + + + + + + + + + 418 + 378 + 325 + 44 + + + + QPushButton:!hover { +font-size:17px; +font-family:HelveticaNeue; +color:rgba(0,106,216,1); +line-height:20px; +background:rgba(255,255,255,1); +border-radius:2px; +border:1px solid rgba(204,204,204,1); +image: url(:/uiresource/edit1.png); +} +QPushButton:hover:pressed { +font-size:17px; +font-family:HelveticaNeue; +color:rgba(0,106,216,1); +line-height:20px; +background:rgba(255,255,255,1); +border-radius:2px; +border:1px solid rgba(204,204,204,1); +image: url(:/uiresource/edit1.png); +} +QPushButton:hover:!pressed { +font-size:17px; +font-family:HelveticaNeue; +color:rgba(255,255,255,1); +line-height:20px; +background:rgba(0,106,216,1); +border-radius:2px; +border:1px solid rgba(204,204,204,1); +image: url(:/uiresource/edit2.png); +} + + + Detail + + + + + + 418 + 437 + 325 + 44 + + + + QPushButton:!hover { +font-size:17px; +font-family:HelveticaNeue; +color:rgba(0,106,216,1); +line-height:20px; +background:rgba(255,255,255,1); +border-radius:2px; +border:1px solid rgba(204,204,204,1); +image: url(:/uiresource/edit1.png); +} +QPushButton:hover:pressed { +font-size:17px; +font-family:HelveticaNeue; +color:rgba(0,106,216,1); +line-height:20px; +background:rgba(255,255,255,1); +border-radius:2px; +border:1px solid rgba(204,204,204,1); +image: url(:/uiresource/edit1.png); +} +QPushButton:hover:!pressed { +font-size:17px; +font-family:HelveticaNeue; +color:rgba(255,255,255,1); +line-height:20px; +background:rgba(0,106,216,1); +border-radius:2px; +border:1px solid rgba(204,204,204,1); +image: url(:/uiresource/edit2.png); +} + + + OK + + + + + + 490 + 280 + 181 + 21 + + + + border-image: url(:/uiresource/edit1.png); +image: url(:/uiresource/edit1.png); +font-size:17px; +font-family:HelveticaNeue; +color:rgba(51,51,51,1); +line-height:20px; + + + TextLabel + + + Qt::AlignCenter + + + + + + + diff --git a/Group-Video/OpenVideoCall-Windows/openvideocall.cpp b/Group-Video/OpenVideoCall-Windows/openvideocall.cpp new file mode 100644 index 00000000..02f1b385 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/openvideocall.cpp @@ -0,0 +1,116 @@ +#include "openvideocall.h" +#include "ui_openvideocall.h" +#include "agorawindowmanager.h" +#include "agoraobject.h" + +OpenVideoCall::OpenVideoCall(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::OpenVideoCall), + m_upAvDevice(Q_NULLPTR) +{ + ui->setupUi(this); + + this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint); + this->setAttribute(Qt::WA_TranslucentBackground); + + AgoraWindowManager::getInstance()->insertItem(qWndType_OpenVideoCall,this); + initWindow(); +} + +OpenVideoCall::~OpenVideoCall() +{ + delete ui; +} + +void OpenVideoCall::initWindow() +{ + QString strDir = QCoreApplication::applicationDirPath(); + strDir.append("\\AgoraSDK.log"); + CAgoraObject::getInstance(this)->setLogPath(strDir); + + CAgoraObject::getInstance()->enableAudio(true); + CAgoraObject::getInstance()->enableVideo(true); + CAgoraObject::getInstance()->EnableWebSdkInteroperability(true); + CAgoraObject::getInstance()->SetChannelProfile(CHANNEL_PROFILE_COMMUNICATION); + + ui->com_encryp->addItem("aes-128-xts"); + ui->com_encryp->addItem("aes-128-ecb"); + ui->com_encryp->addItem("aes-256-xts"); + ui->com_encryp->setCurrentIndex(0); +} + +void OpenVideoCall::mousePressEvent(QMouseEvent *e) +{ + if(e->button() == Qt::LeftButton) { + m_mousePosition = e->pos(); + if(m_mousePosition.x() < lnTitleWidth && + m_mousePosition.x() >= lnGapWidth && + m_mousePosition.y() >= lnGapHeight && + m_mousePosition.y() < lnTitleHeight) + m_bMousePressed = true; + } +} + +void OpenVideoCall::mouseMoveEvent(QMouseEvent *e) +{ + if(m_bMousePressed == true) { + QPoint movePos = e->globalPos() - m_mousePosition; + move(movePos); + e->accept(); + } +} + +void OpenVideoCall::mouseReleaseEvent(QMouseEvent *e) +{ + m_bMousePressed = false; +} + +void OpenVideoCall::on_btn_close_clicked() +{ + this->close(); +} + +void OpenVideoCall::on_btn_min_clicked() +{ + this->showMinimized(); +} + +void OpenVideoCall::on_btn_config_clicked() +{ + this->hide(); + QString qsChannel = ui->led_classid->text(); + m_upAvDevice.reset(new AVDevice(this,qsChannel)); + m_upAvDevice->show(); +} + +void OpenVideoCall::on_led_classid_returnPressed() +{ + //todo;ignore. +} + +void OpenVideoCall::on_btn_test_network_clicked() +{ + this->hide(); + m_upNetTesting.reset(new NetTesting()); + m_upNetTesting->show(); +} + +void OpenVideoCall::on_btn_join_clicked() +{ + //to do joinchannel. + QString qsClassId = ui->led_classid->text(); + this->hide(); + + QString qsEncrypSecret = ui->led_key->text(); + QString qsEncrypMode = ui->com_encryp->currentText(); + CAgoraObject::getInstance()->SetEncryptionMode(qsEncrypSecret.toUtf8().data(),qsEncrypMode.toUtf8().data()); + + m_upInRoom.reset(new InRoom()); + m_upInRoom->joinchannel(qsClassId,APP_TOKEN,0); +} + +void OpenVideoCall::on_com_encryp_currentIndexChanged(const QString &arg1) +{ + QString qsEncrypSecret = ui->led_key->text(); + CAgoraObject::getInstance()->SetEncryptionMode(qsEncrypSecret.toUtf8().data(),arg1.toUtf8().data()); +} diff --git a/Group-Video/OpenVideoCall-Windows/openvideocall.h b/Group-Video/OpenVideoCall-Windows/openvideocall.h new file mode 100644 index 00000000..7d02fbd7 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/openvideocall.h @@ -0,0 +1,55 @@ +#ifndef OPENVIDEOCALL_H +#define OPENVIDEOCALL_H + +#include +#include +#include "avdevice.h" +#include "nettesting.h" +#include +#include "inroom.h" + +namespace Ui { +class OpenVideoCall; +} + +class OpenVideoCall : public QMainWindow +{ + Q_OBJECT + +public: + explicit OpenVideoCall(QWidget *parent = 0); + ~OpenVideoCall(); + +protected: + virtual void mousePressEvent(QMouseEvent *e); + virtual void mouseMoveEvent(QMouseEvent *e); + virtual void mouseReleaseEvent(QMouseEvent *e); + + void initWindow(); + +private slots: + void on_btn_close_clicked(); + void on_btn_min_clicked(); + void on_btn_config_clicked(); + void on_led_classid_returnPressed(); + void on_btn_test_network_clicked(); + void on_btn_join_clicked(); + + void on_com_encryp_currentIndexChanged(const QString &arg1); + +private: + const int lnGapWidth = 18; + const int lnGapHeight = 12; + const int lnTitleWidth = 718; + const int lnTitleHeight = 30; + QPoint m_mousePosition; + bool m_bMousePressed; + +private: + Ui::OpenVideoCall *ui; + std::unique_ptr m_upAvDevice; + std::unique_ptr m_upNetTesting; + std::unique_ptr m_upInRoom; +}; + +#endif // OPENVIDEOCALL_H diff --git a/Group-Video/OpenVideoCall-Windows/openvideocall.ico b/Group-Video/OpenVideoCall-Windows/openvideocall.ico new file mode 100644 index 00000000..3a363714 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/openvideocall.ico differ diff --git a/Group-Video/OpenVideoCall-Windows/openvideocall.qrc b/Group-Video/OpenVideoCall-Windows/openvideocall.qrc new file mode 100644 index 00000000..18ebd381 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/openvideocall.qrc @@ -0,0 +1,50 @@ + + + uiresource/icon-back hover.png + uiresource/icon-back.png + uiresource/icon-camera off.png + uiresource/icon-camera.png + uiresource/icon-close hover.png + uiresource/icon-hang up hover.png + uiresource/icon-hang up.png + uiresource/icon-loading.png + uiresource/icon-micorophone off.png + uiresource/icon-micorophone.png + uiresource/icon-setting hover.png + uiresource/icon-setting.png + uiresource/OVC-win-03.jpg + uiresource/OVC-win-config.png + uiresource/OVC-win-home.png + uiresource/OVC-win-more users.jpg + uiresource/OVC-win-netdetail.png + uiresource/OVC-win-netresult.png + uiresource/OVC-win-nettest.png + uiresource/gray.png + uiresource/icon-close default.png + uiresource/icon-min default.png + uiresource/icon-min hover.png + uiresource/edit.png + uiresource/edit1.png + uiresource/edit2.png + uiresource/switch-off.png + uiresource/switch-open.png + uiresource/edit3.png + uiresource/loading.gif + uiresource/pic-bad.png + uiresource/pic-good.png + uiresource/pic-poor.png + uiresource/edit4.png + uiresource/edit5.png + uiresource/icon-camera on.png + uiresource/icon-micorophone on.png + uiresource/allmute remote.png + uiresource/allmute.png + uiresource/mutevideo remote.png + uiresource/mutevideo.png + uiresource/box-01.png + uiresource/dropdow-01.png + uiresource/dropdown-02.png + uiresource/dropdown-03.png + uiresource/slider.png + + diff --git a/Group-Video/OpenVideoCall-Windows/openvideocall.rc b/Group-Video/OpenVideoCall-Windows/openvideocall.rc new file mode 100644 index 00000000..6b34d015 --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/openvideocall.rc @@ -0,0 +1 @@ + IDI_ICON ICON DISCARDABLE "openvideocall.ico" diff --git a/Group-Video/OpenVideoCall-Windows/openvideocall.ui b/Group-Video/OpenVideoCall-Windows/openvideocall.ui new file mode 100644 index 00000000..15daaade --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/openvideocall.ui @@ -0,0 +1,252 @@ + + + OpenVideoCall + + + + 0 + 0 + 786 + 536 + + + + MainWindow + + + + image: url(:/uiresource/OVC-win-home.png); + + + + + 726 + 34 + 18 + 18 + + + + QPushButton:!hover { +image: url(:/uiresource/icon-close default.png); +border-image: url(:/uiresource/icon-close default.png); +} + +QPushButton:hover { +image: url(:/uiresource/icon-close hover.png); +border-image: url(:/uiresource/icon-close hover.png); +} + + + + + + + + + 418 + 25 + 36 + 36 + + + + QPushButton:!hover { +border-image: url(:/uiresource/icon-setting.png); +image: url(:/uiresource/icon-setting.png); +} + +QPushButton:hover { +border-image: url(:/uiresource/icon-setting hover.png); +image: url(:/uiresource/icon-setting hover.png); +} + + + + + + + + + 698 + 34 + 18 + 18 + + + + QPushButton:!hover { +image: url(:/uiresource/icon-min default.png); +border-image: url(:/uiresource/icon-min default.png); +} + +QPushButton:hover { +image: url(:/uiresource/icon-min hover.png); +border-image: url(:/uiresource/icon-min hover.png); +} + + + + + + + + + 418 + 152 + 325 + 40 + + + + width:325px; +height:40px; +border-radius:2px; +image: url(:/uiresource/edit1.png); +font-size:14px; +font-family:HelveticaNeue; +color:rgba(153,153,153,1); +line-height:16px; + + + + Input Name + + + + + + 418 + 216 + 205 + 40 + + + + width:205px; +height:40px; +border-radius:2px; +image: url(:/uiresource/edit1.png); +font-size:14px; +font-family:HelveticaNeue; +color:rgba(153,153,153,1); +line-height:16px; + + + + Encryption key + + + + + + 418 + 378 + 325 + 44 + + + + QPushButton:!hover { +font-size:17px; +font-family:HelveticaNeue; +color:rgba(0,106,216,1); +line-height:20px; +background:rgba(255,255,255,1); +border-radius:2px; +border:1px solid rgba(204,204,204,1); +image: url(:/uiresource/edit1.png); +} +QPushButton:hover:pressed { +font-size:17px; +font-family:HelveticaNeue; +color:rgba(0,106,216,1); +line-height:20px; +background:rgba(255,255,255,1); +border-radius:2px; +border:1px solid rgba(204,204,204,1); +image: url(:/uiresource/edit1.png); +} +QPushButton:hover:!pressed { +font-size:17px; +font-family:HelveticaNeue; +color:rgba(255,255,255,1); +line-height:20px; +background:rgba(0,106,216,1); +border-radius:2px; +border:1px solid rgba(204,204,204,1); +image: url(:/uiresource/edit2.png); +} + + + Test your Network + + + + + + 418 + 437 + 325 + 44 + + + + QPushButton:!hover { +font-size:17px; +font-family:HelveticaNeue; +color:rgba(0,106,216,1); +line-height:20px; +background:rgba(255,255,255,1); +border-radius:2px; +border:1px solid rgba(204,204,204,1); +image: url(:/uiresource/edit1.png); +} +QPushButton:hover:pressed { +font-size:17px; +font-family:HelveticaNeue; +color:rgba(0,106,216,1); +line-height:20px; +background:rgba(255,255,255,1); +border-radius:2px; +border:1px solid rgba(204,204,204,1); +image: url(:/uiresource/edit1.png); +} + +QPushButton:hover:!pressed { +font-size:17px; +font-family:HelveticaNeue; +color:rgba(255,255,255,1); +line-height:20px; +background:rgba(0,106,216,1); +border-radius:2px; +border:1px solid rgba(204,204,204,1); +image: url(:/uiresource/edit2.png); +} + + + joinChannel + + + + + + 634 + 216 + 110 + 44 + + + + font-size:17px; +font-family:HelveticaNeue; +color:rgba(0,106,216,1); +line-height:20px; + + + + + + + + diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/OVC-win-03.jpg b/Group-Video/OpenVideoCall-Windows/uiresource/OVC-win-03.jpg new file mode 100644 index 00000000..c5d2415a Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/OVC-win-03.jpg differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/OVC-win-config.png b/Group-Video/OpenVideoCall-Windows/uiresource/OVC-win-config.png new file mode 100644 index 00000000..172e926e Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/OVC-win-config.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/OVC-win-home.png b/Group-Video/OpenVideoCall-Windows/uiresource/OVC-win-home.png new file mode 100644 index 00000000..7592b274 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/OVC-win-home.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/OVC-win-more users.jpg b/Group-Video/OpenVideoCall-Windows/uiresource/OVC-win-more users.jpg new file mode 100644 index 00000000..5cf7d26b Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/OVC-win-more users.jpg differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/OVC-win-netdetail.png b/Group-Video/OpenVideoCall-Windows/uiresource/OVC-win-netdetail.png new file mode 100644 index 00000000..bcaa6c84 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/OVC-win-netdetail.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/OVC-win-netresult.png b/Group-Video/OpenVideoCall-Windows/uiresource/OVC-win-netresult.png new file mode 100644 index 00000000..42d332b1 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/OVC-win-netresult.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/OVC-win-nettest.png b/Group-Video/OpenVideoCall-Windows/uiresource/OVC-win-nettest.png new file mode 100644 index 00000000..3e04acff Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/OVC-win-nettest.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/allmute remote.png b/Group-Video/OpenVideoCall-Windows/uiresource/allmute remote.png new file mode 100644 index 00000000..935e1d6d Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/allmute remote.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/allmute.png b/Group-Video/OpenVideoCall-Windows/uiresource/allmute.png new file mode 100644 index 00000000..3888d67b Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/allmute.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/box-01.png b/Group-Video/OpenVideoCall-Windows/uiresource/box-01.png new file mode 100644 index 00000000..965e993b Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/box-01.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/dropdow-01.png b/Group-Video/OpenVideoCall-Windows/uiresource/dropdow-01.png new file mode 100644 index 00000000..5dac3f5f Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/dropdow-01.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/dropdown-02.png b/Group-Video/OpenVideoCall-Windows/uiresource/dropdown-02.png new file mode 100644 index 00000000..8351a69e Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/dropdown-02.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/dropdown-03.png b/Group-Video/OpenVideoCall-Windows/uiresource/dropdown-03.png new file mode 100644 index 00000000..ccb145e3 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/dropdown-03.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/edit.png b/Group-Video/OpenVideoCall-Windows/uiresource/edit.png new file mode 100644 index 00000000..cae6abf4 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/edit.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/edit1.png b/Group-Video/OpenVideoCall-Windows/uiresource/edit1.png new file mode 100644 index 00000000..cae6abf4 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/edit1.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/edit2.png b/Group-Video/OpenVideoCall-Windows/uiresource/edit2.png new file mode 100644 index 00000000..e787b64d Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/edit2.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/edit3.png b/Group-Video/OpenVideoCall-Windows/uiresource/edit3.png new file mode 100644 index 00000000..a735c8e8 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/edit3.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/edit4.png b/Group-Video/OpenVideoCall-Windows/uiresource/edit4.png new file mode 100644 index 00000000..ca4ec3a0 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/edit4.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/edit5.png b/Group-Video/OpenVideoCall-Windows/uiresource/edit5.png new file mode 100644 index 00000000..e2a07d4d Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/edit5.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/gray.png b/Group-Video/OpenVideoCall-Windows/uiresource/gray.png new file mode 100644 index 00000000..e6f0b7cd Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/gray.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/icon-back hover.png b/Group-Video/OpenVideoCall-Windows/uiresource/icon-back hover.png new file mode 100644 index 00000000..031775ce Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/icon-back hover.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/icon-back.png b/Group-Video/OpenVideoCall-Windows/uiresource/icon-back.png new file mode 100644 index 00000000..5077aaa0 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/icon-back.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/icon-camera off.png b/Group-Video/OpenVideoCall-Windows/uiresource/icon-camera off.png new file mode 100644 index 00000000..bbaa9c05 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/icon-camera off.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/icon-camera on.png b/Group-Video/OpenVideoCall-Windows/uiresource/icon-camera on.png new file mode 100644 index 00000000..226ce848 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/icon-camera on.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/icon-camera.png b/Group-Video/OpenVideoCall-Windows/uiresource/icon-camera.png new file mode 100644 index 00000000..2332489b Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/icon-camera.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/icon-close default.png b/Group-Video/OpenVideoCall-Windows/uiresource/icon-close default.png new file mode 100644 index 00000000..6735d5f0 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/icon-close default.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/icon-close hover.png b/Group-Video/OpenVideoCall-Windows/uiresource/icon-close hover.png new file mode 100644 index 00000000..8965d034 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/icon-close hover.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/icon-hang up hover.png b/Group-Video/OpenVideoCall-Windows/uiresource/icon-hang up hover.png new file mode 100644 index 00000000..2a0783d2 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/icon-hang up hover.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/icon-hang up.png b/Group-Video/OpenVideoCall-Windows/uiresource/icon-hang up.png new file mode 100644 index 00000000..3c27092c Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/icon-hang up.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/icon-loading.png b/Group-Video/OpenVideoCall-Windows/uiresource/icon-loading.png new file mode 100644 index 00000000..7de17edc Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/icon-loading.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/icon-micorophone off.png b/Group-Video/OpenVideoCall-Windows/uiresource/icon-micorophone off.png new file mode 100644 index 00000000..e70b1577 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/icon-micorophone off.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/icon-micorophone on.png b/Group-Video/OpenVideoCall-Windows/uiresource/icon-micorophone on.png new file mode 100644 index 00000000..baa07a6e Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/icon-micorophone on.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/icon-micorophone.png b/Group-Video/OpenVideoCall-Windows/uiresource/icon-micorophone.png new file mode 100644 index 00000000..a5771377 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/icon-micorophone.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/icon-min default.png b/Group-Video/OpenVideoCall-Windows/uiresource/icon-min default.png new file mode 100644 index 00000000..a6506b8d Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/icon-min default.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/icon-min hover.png b/Group-Video/OpenVideoCall-Windows/uiresource/icon-min hover.png new file mode 100644 index 00000000..47aab300 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/icon-min hover.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/icon-setting hover.png b/Group-Video/OpenVideoCall-Windows/uiresource/icon-setting hover.png new file mode 100644 index 00000000..7bf3c243 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/icon-setting hover.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/icon-setting.png b/Group-Video/OpenVideoCall-Windows/uiresource/icon-setting.png new file mode 100644 index 00000000..59b3e382 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/icon-setting.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/loading.gif b/Group-Video/OpenVideoCall-Windows/uiresource/loading.gif new file mode 100644 index 00000000..31b9f318 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/loading.gif differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/mutevideo remote.png b/Group-Video/OpenVideoCall-Windows/uiresource/mutevideo remote.png new file mode 100644 index 00000000..f1d510bc Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/mutevideo remote.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/mutevideo.png b/Group-Video/OpenVideoCall-Windows/uiresource/mutevideo.png new file mode 100644 index 00000000..7e1cfd44 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/mutevideo.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/pic-bad.png b/Group-Video/OpenVideoCall-Windows/uiresource/pic-bad.png new file mode 100644 index 00000000..f0977107 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/pic-bad.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/pic-good.png b/Group-Video/OpenVideoCall-Windows/uiresource/pic-good.png new file mode 100644 index 00000000..d600645b Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/pic-good.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/pic-poor.png b/Group-Video/OpenVideoCall-Windows/uiresource/pic-poor.png new file mode 100644 index 00000000..dab0fd5a Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/pic-poor.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/qlabel.h b/Group-Video/OpenVideoCall-Windows/uiresource/qlabel.h new file mode 100644 index 00000000..1a3a68db --- /dev/null +++ b/Group-Video/OpenVideoCall-Windows/uiresource/qlabel.h @@ -0,0 +1,157 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the QtWidgets module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QLABEL_H +#define QLABEL_H + +#include + +QT_BEGIN_NAMESPACE + + +class QLabelPrivate; + +class Q_WIDGETS_EXPORT QLabel : public QFrame +{ + Q_OBJECT + Q_PROPERTY(QString text READ text WRITE setText) + Q_PROPERTY(Qt::TextFormat textFormat READ textFormat WRITE setTextFormat) + Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap) + Q_PROPERTY(bool scaledContents READ hasScaledContents WRITE setScaledContents) + Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment) + Q_PROPERTY(bool wordWrap READ wordWrap WRITE setWordWrap) + Q_PROPERTY(int margin READ margin WRITE setMargin) + Q_PROPERTY(int indent READ indent WRITE setIndent) + Q_PROPERTY(bool openExternalLinks READ openExternalLinks WRITE setOpenExternalLinks) + Q_PROPERTY(Qt::TextInteractionFlags textInteractionFlags READ textInteractionFlags WRITE setTextInteractionFlags) + Q_PROPERTY(bool hasSelectedText READ hasSelectedText) + Q_PROPERTY(QString selectedText READ selectedText) + +public: + explicit QLabel(QWidget *parent=Q_NULLPTR, Qt::WindowFlags f=Qt::WindowFlags()); + explicit QLabel(const QString &text, QWidget *parent=Q_NULLPTR, Qt::WindowFlags f=Qt::WindowFlags()); + ~QLabel(); + + QString text() const; + const QPixmap *pixmap() const; +#ifndef QT_NO_PICTURE + const QPicture *picture() const; +#endif +#ifndef QT_NO_MOVIE + QMovie *movie() const; +#endif + + Qt::TextFormat textFormat() const; + void setTextFormat(Qt::TextFormat); + + Qt::Alignment alignment() const; + void setAlignment(Qt::Alignment); + + void setWordWrap(bool on); + bool wordWrap() const; + + int indent() const; + void setIndent(int); + + int margin() const; + void setMargin(int); + + bool hasScaledContents() const; + void setScaledContents(bool); + QSize sizeHint() const Q_DECL_OVERRIDE; + QSize minimumSizeHint() const Q_DECL_OVERRIDE; +#ifndef QT_NO_SHORTCUT + void setBuddy(QWidget *); + QWidget *buddy() const; +#endif + int heightForWidth(int) const Q_DECL_OVERRIDE; + + bool openExternalLinks() const; + void setOpenExternalLinks(bool open); + + void setTextInteractionFlags(Qt::TextInteractionFlags flags); + Qt::TextInteractionFlags textInteractionFlags() const; + + void setSelection(int, int); + bool hasSelectedText() const; + QString selectedText() const; + int selectionStart() const; + +public Q_SLOTS: + void setText(const QString &); + void setPixmap(const QPixmap &); +#ifndef QT_NO_PICTURE + void setPicture(const QPicture &); +#endif +#ifndef QT_NO_MOVIE + void setMovie(QMovie *movie); +#endif + void setNum(int); + void setNum(double); + void clear(); + +Q_SIGNALS: + void linkActivated(const QString& link); + void linkHovered(const QString& link); + +protected: + bool event(QEvent *e) Q_DECL_OVERRIDE; + void keyPressEvent(QKeyEvent *ev) Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; + void changeEvent(QEvent *) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *ev) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *ev) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *ev) Q_DECL_OVERRIDE; + void contextMenuEvent(QContextMenuEvent *ev) Q_DECL_OVERRIDE; + void focusInEvent(QFocusEvent *ev) Q_DECL_OVERRIDE; + void focusOutEvent(QFocusEvent *ev) Q_DECL_OVERRIDE; + bool focusNextPrevChild(bool next) Q_DECL_OVERRIDE; + + +private: + Q_DISABLE_COPY(QLabel) + Q_DECLARE_PRIVATE(QLabel) +#ifndef QT_NO_MOVIE + Q_PRIVATE_SLOT(d_func(), void _q_movieUpdated(const QRect&)) + Q_PRIVATE_SLOT(d_func(), void _q_movieResized(const QSize&)) +#endif + Q_PRIVATE_SLOT(d_func(), void _q_linkHovered(const QString &)) + + friend class QTipLabel; + friend class QMessageBoxPrivate; + friend class QBalloonTip; +}; + +QT_END_NAMESPACE + +#endif // QLABEL_H diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/slider.png b/Group-Video/OpenVideoCall-Windows/uiresource/slider.png new file mode 100644 index 00000000..3dabab78 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/slider.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/switch-off.png b/Group-Video/OpenVideoCall-Windows/uiresource/switch-off.png new file mode 100644 index 00000000..168f5db0 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/switch-off.png differ diff --git a/Group-Video/OpenVideoCall-Windows/uiresource/switch-open.png b/Group-Video/OpenVideoCall-Windows/uiresource/switch-open.png new file mode 100644 index 00000000..f571e8c8 Binary files /dev/null and b/Group-Video/OpenVideoCall-Windows/uiresource/switch-open.png differ diff --git a/Group-Video/OpenVideoCall-iOS-Objective-C/OpenVideoCall.xcodeproj/project.pbxproj b/Group-Video/OpenVideoCall-iOS-Objective-C/OpenVideoCall.xcodeproj/project.pbxproj index acdf043c..6c680451 100644 --- a/Group-Video/OpenVideoCall-iOS-Objective-C/OpenVideoCall.xcodeproj/project.pbxproj +++ b/Group-Video/OpenVideoCall-iOS-Objective-C/OpenVideoCall.xcodeproj/project.pbxproj @@ -19,25 +19,26 @@ 076C59A51DDDBF3100F813E2 /* VideoSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 076C59A21DDDBF3100F813E2 /* VideoSession.m */; }; 076C59A61DDDBF3100F813E2 /* VideoViewLayouter.m in Sources */ = {isa = PBXBuildFile; fileRef = 076C59A41DDDBF3100F813E2 /* VideoViewLayouter.m */; }; 076C59A91DDDC9FD00F813E2 /* VideoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 076C59A81DDDC9FD00F813E2 /* VideoView.m */; }; - 076C59AC1DDDDE5D00F813E2 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 076C59AB1DDDDE5D00F813E2 /* CoreTelephony.framework */; }; - 076C59AE1DDDDE6100F813E2 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 076C59AD1DDDDE6100F813E2 /* CoreMedia.framework */; }; - 076C59B01DDDDE6900F813E2 /* VideoToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 076C59AF1DDDDE6900F813E2 /* VideoToolbox.framework */; }; - 076C59B21DDDDE7000F813E2 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 076C59B11DDDDE7000F813E2 /* AudioToolbox.framework */; }; - 076C59B41DDDDE7600F813E2 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 076C59B31DDDDE7600F813E2 /* libc++.tbd */; }; - 076C59B61DDDDE7A00F813E2 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 076C59B51DDDDE7A00F813E2 /* AVFoundation.framework */; }; - 07D29C5B1E9E1ED900C3583C /* AgoraRtcEngineKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 07D29C5A1E9E1ED900C3583C /* AgoraRtcEngineKit.framework */; }; - 07D29C5D1E9E1EFE00C3583C /* libresolv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 07D29C5C1E9E1EFE00C3583C /* libresolv.tbd */; }; - 0FB4FB651FF1F979006C7AE3 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0FB4FB641FF1F979006C7AE3 /* SystemConfiguration.framework */; }; 3832FA5F227FC9DA00E50E69 /* FileCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3832FA5E227FC9DA00E50E69 /* FileCenter.m */; }; 3832FA67227FF94300E50E69 /* Them.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 3832FA66227FF94200E50E69 /* Them.mp3 */; }; - 385F305B2122CB13005D5301 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 385F305A2122CB13005D5301 /* Accelerate.framework */; }; - 389D99A7218831C900BFD852 /* AgoraRtcCryptoLoader.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 389D99A6218831C900BFD852 /* AgoraRtcCryptoLoader.framework */; }; - 389D99A9218831D000BFD852 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 389D99A8218831D000BFD852 /* libcrypto.a */; }; - 38D619362250BF34004A6C87 /* CoreML.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 38D619352250BF34004A6C87 /* CoreML.framework */; }; 38EF7E902368269600A6A483 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 38EF7E8F2368269600A6A483 /* README.md */; }; A7327ECE1FC7B5E300882882 /* Encryption.m in Sources */ = {isa = PBXBuildFile; fileRef = A7327ECD1FC7B5E300882882 /* Encryption.m */; }; A7327ED41FC7C7DB00882882 /* MessageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A7327ED31FC7C7DB00882882 /* MessageCell.m */; }; A7327ED71FC7C7EE00882882 /* Message.m in Sources */ = {isa = PBXBuildFile; fileRef = A7327ED61FC7C7EE00882882 /* Message.m */; }; + A76C26C7238684C20047E150 /* AgoraRtcKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A76C26C5238684C20047E150 /* AgoraRtcKit.framework */; }; + A76C26CE238684CB0047E150 /* AgoraRtcCryptoLoader.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A76C26CC238684CB0047E150 /* AgoraRtcCryptoLoader.framework */; }; + A7733D6424079BFA00483870 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A7733D6324079BEF00483870 /* libcrypto.a */; }; + A7733D6524079BFF00483870 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 385F305A2122CB13005D5301 /* Accelerate.framework */; }; + A7733D6624079C0500483870 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 076C59B11DDDDE7000F813E2 /* AudioToolbox.framework */; }; + A7733D6724079C0A00483870 /* VideoToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 076C59AF1DDDDE6900F813E2 /* VideoToolbox.framework */; }; + A7733D6824079C0F00483870 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 076C59B51DDDDE7A00F813E2 /* AVFoundation.framework */; }; + A7733D6924079C1800483870 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 076C59AD1DDDDE6100F813E2 /* CoreMedia.framework */; }; + A7733D6A24079C2000483870 /* CoreML.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 38D619352250BF34004A6C87 /* CoreML.framework */; }; + A7733D6C24079C2B00483870 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7733D6B24079C2B00483870 /* CoreMotion.framework */; }; + A7733D6D24079C3600483870 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 076C59AB1DDDDE5D00F813E2 /* CoreTelephony.framework */; }; + A7733D6E24079C3E00483870 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 076C59B31DDDDE7600F813E2 /* libc++.tbd */; }; + A7733D6F24079C4500483870 /* libresolv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 07D29C5C1E9E1EFE00C3583C /* libresolv.tbd */; }; + A7733D7024079C4B00483870 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0FB4FB641FF1F979006C7AE3 /* SystemConfiguration.framework */; }; A7FB1B6222A638500027986E /* Settings.m in Sources */ = {isa = PBXBuildFile; fileRef = A7FB1B6122A638500027986E /* Settings.m */; }; A7FB1B6822A640680027986E /* CommonExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = A7FB1B6722A640680027986E /* CommonExtension.m */; }; A7FB1B6B22A6437B0027986E /* MediaCharater.m in Sources */ = {isa = PBXBuildFile; fileRef = A7FB1B6A22A6437B0027986E /* MediaCharater.m */; }; @@ -78,15 +79,12 @@ 076C59B11DDDDE7000F813E2 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; 076C59B31DDDDE7600F813E2 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; }; 076C59B51DDDDE7A00F813E2 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; - 07D29C5A1E9E1ED900C3583C /* AgoraRtcEngineKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AgoraRtcEngineKit.framework; sourceTree = ""; }; 07D29C5C1E9E1EFE00C3583C /* libresolv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.tbd; path = usr/lib/libresolv.tbd; sourceTree = SDKROOT; }; 0FB4FB641FF1F979006C7AE3 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 3832FA5D227FC9DA00E50E69 /* FileCenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FileCenter.h; sourceTree = ""; }; 3832FA5E227FC9DA00E50E69 /* FileCenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FileCenter.m; sourceTree = ""; }; 3832FA66227FF94200E50E69 /* Them.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; name = Them.mp3; path = ../../SharedFiles/Them.mp3; sourceTree = ""; }; 385F305A2122CB13005D5301 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; - 389D99A6218831C900BFD852 /* AgoraRtcCryptoLoader.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AgoraRtcCryptoLoader.framework; sourceTree = ""; }; - 389D99A8218831D000BFD852 /* libcrypto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrypto.a; sourceTree = ""; }; 38D619352250BF34004A6C87 /* CoreML.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreML.framework; path = System/Library/Frameworks/CoreML.framework; sourceTree = SDKROOT; }; 38EF7E8F2368269600A6A483 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; A7327ECC1FC7B5E300882882 /* Encryption.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Encryption.h; sourceTree = ""; }; @@ -95,6 +93,12 @@ A7327ED31FC7C7DB00882882 /* MessageCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageCell.m; sourceTree = ""; }; A7327ED51FC7C7EE00882882 /* Message.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Message.h; sourceTree = ""; }; A7327ED61FC7C7EE00882882 /* Message.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Message.m; sourceTree = ""; }; + A76C26C5238684C20047E150 /* AgoraRtcKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AgoraRtcKit.framework; path = OpenVideoCall/AgoraRtcKit.framework; sourceTree = ""; }; + A76C26C6238684C20047E150 /* AgoraRtcCryptoLoader.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AgoraRtcCryptoLoader.framework; path = OpenVideoCall/AgoraRtcCryptoLoader.framework; sourceTree = ""; }; + A76C26CC238684CB0047E150 /* AgoraRtcCryptoLoader.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AgoraRtcCryptoLoader.framework; sourceTree = ""; }; + A76C26CD238684CB0047E150 /* AgoraRtcKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AgoraRtcKit.framework; sourceTree = ""; }; + A7733D6324079BEF00483870 /* libcrypto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcrypto.a; path = OpenVideoCall/libcrypto.a; sourceTree = ""; }; + A7733D6B24079C2B00483870 /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; A7FB1B6022A638500027986E /* Settings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Settings.h; sourceTree = ""; }; A7FB1B6122A638500027986E /* Settings.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Settings.m; sourceTree = ""; }; A7FB1B6622A640680027986E /* CommonExtension.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CommonExtension.h; sourceTree = ""; }; @@ -117,19 +121,20 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 385F305B2122CB13005D5301 /* Accelerate.framework in Frameworks */, - 38D619362250BF34004A6C87 /* CoreML.framework in Frameworks */, - 0FB4FB651FF1F979006C7AE3 /* SystemConfiguration.framework in Frameworks */, - 389D99A9218831D000BFD852 /* libcrypto.a in Frameworks */, - 07D29C5D1E9E1EFE00C3583C /* libresolv.tbd in Frameworks */, - 076C59B61DDDDE7A00F813E2 /* AVFoundation.framework in Frameworks */, - 389D99A7218831C900BFD852 /* AgoraRtcCryptoLoader.framework in Frameworks */, - 076C59B41DDDDE7600F813E2 /* libc++.tbd in Frameworks */, - 076C59B21DDDDE7000F813E2 /* AudioToolbox.framework in Frameworks */, - 076C59B01DDDDE6900F813E2 /* VideoToolbox.framework in Frameworks */, - 07D29C5B1E9E1ED900C3583C /* AgoraRtcEngineKit.framework in Frameworks */, - 076C59AE1DDDDE6100F813E2 /* CoreMedia.framework in Frameworks */, - 076C59AC1DDDDE5D00F813E2 /* CoreTelephony.framework in Frameworks */, + A7733D6924079C1800483870 /* CoreMedia.framework in Frameworks */, + A76C26C7238684C20047E150 /* AgoraRtcKit.framework in Frameworks */, + A7733D6524079BFF00483870 /* Accelerate.framework in Frameworks */, + A7733D6D24079C3600483870 /* CoreTelephony.framework in Frameworks */, + A7733D6C24079C2B00483870 /* CoreMotion.framework in Frameworks */, + A7733D6F24079C4500483870 /* libresolv.tbd in Frameworks */, + A7733D6724079C0A00483870 /* VideoToolbox.framework in Frameworks */, + A7733D6E24079C3E00483870 /* libc++.tbd in Frameworks */, + A7733D7024079C4B00483870 /* SystemConfiguration.framework in Frameworks */, + A7733D6624079C0500483870 /* AudioToolbox.framework in Frameworks */, + A76C26CE238684CB0047E150 /* AgoraRtcCryptoLoader.framework in Frameworks */, + A7733D6824079C0F00483870 /* AVFoundation.framework in Frameworks */, + A7733D6424079BFA00483870 /* libcrypto.a in Frameworks */, + A7733D6A24079C2000483870 /* CoreML.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -160,16 +165,9 @@ 076C598F1DDDBCFE00F813E2 /* Controllers */, 076C59901DDDBD0600F813E2 /* Views */, 076C59911DDDBD0D00F813E2 /* Models */, - 07D29C5A1E9E1ED900C3583C /* AgoraRtcEngineKit.framework */, - 389D99A6218831C900BFD852 /* AgoraRtcCryptoLoader.framework */, - 389D99A8218831D000BFD852 /* libcrypto.a */, - 076C59781DDDBC3500F813E2 /* AppDelegate.h */, - 076C59791DDDBC3500F813E2 /* AppDelegate.m */, - 076C59811DDDBC3500F813E2 /* Assets.xcassets */, - 076C59831DDDBC3500F813E2 /* LaunchScreen.storyboard */, - 3832FA66227FF94200E50E69 /* Them.mp3 */, - 076C59861DDDBC3500F813E2 /* Info.plist */, 076C59751DDDBC3500F813E2 /* Supporting Files */, + A76C26CC238684CB0047E150 /* AgoraRtcCryptoLoader.framework */, + A76C26CD238684CB0047E150 /* AgoraRtcKit.framework */, ); path = OpenVideoCall; sourceTree = ""; @@ -177,6 +175,12 @@ 076C59751DDDBC3500F813E2 /* Supporting Files */ = { isa = PBXGroup; children = ( + 076C59781DDDBC3500F813E2 /* AppDelegate.h */, + 076C59791DDDBC3500F813E2 /* AppDelegate.m */, + 076C59811DDDBC3500F813E2 /* Assets.xcassets */, + 076C59831DDDBC3500F813E2 /* LaunchScreen.storyboard */, + 3832FA66227FF94200E50E69 /* Them.mp3 */, + 076C59861DDDBC3500F813E2 /* Info.plist */, 076C59761DDDBC3500F813E2 /* main.m */, ); name = "Supporting Files"; @@ -245,6 +249,10 @@ 076C59AA1DDDDE5C00F813E2 /* Frameworks */ = { isa = PBXGroup; children = ( + A7733D6B24079C2B00483870 /* CoreMotion.framework */, + A7733D6324079BEF00483870 /* libcrypto.a */, + A76C26C6238684C20047E150 /* AgoraRtcCryptoLoader.framework */, + A76C26C5238684C20047E150 /* AgoraRtcKit.framework */, 38D619352250BF34004A6C87 /* CoreML.framework */, 385F305A2122CB13005D5301 /* Accelerate.framework */, 0FB4FB641FF1F979006C7AE3 /* SystemConfiguration.framework */, diff --git a/Group-Video/OpenVideoCall-iOS-Objective-C/OpenVideoCall/Base.lproj/Main.storyboard b/Group-Video/OpenVideoCall-iOS-Objective-C/OpenVideoCall/Base.lproj/Main.storyboard index 3c0b3705..ab7dc725 100644 --- a/Group-Video/OpenVideoCall-iOS-Objective-C/OpenVideoCall/Base.lproj/Main.storyboard +++ b/Group-Video/OpenVideoCall-iOS-Objective-C/OpenVideoCall/Base.lproj/Main.storyboard @@ -1,11 +1,9 @@ - - - - + + - + @@ -15,7 +13,7 @@ - + + @@ -34,7 +33,8 @@ - + + @@ -146,7 +146,7 @@ @@ -173,14 +173,14 @@ - + - + @@ -206,6 +206,7 @@ + @@ -218,7 +219,7 @@ - + @@ -244,6 +245,7 @@ + @@ -256,7 +258,7 @@ - + @@ -282,6 +284,7 @@ + @@ -294,7 +297,7 @@ - + @@ -320,6 +323,7 @@ + @@ -355,11 +359,11 @@ - + -