Skip to content

Commit

Permalink
[windows] #5, #18, #20
Browse files Browse the repository at this point in the history
  • Loading branch information
ffiirree committed Mar 22, 2023
1 parent 2f6f340 commit d36584b
Show file tree
Hide file tree
Showing 21 changed files with 687 additions and 226 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

find_package(Qt5 COMPONENTS Widgets Gui Multimedia LinguistTools REQUIRED)
find_package(Qt5 COMPONENTS Widgets Gui LinguistTools REQUIRED)
find_package(FFmpeg COMPONENTS avutil avcodec avformat avdevice avfilter REQUIRED)

if(WIN32)
Expand Down Expand Up @@ -68,7 +68,6 @@ target_link_libraries(${PROJECT_NAME}
FFmpeg::avutil FFmpeg::avcodec FFmpeg::avformat FFmpeg::avdevice FFmpeg::avfilter
$<$<PLATFORM_ID:Windows>:dwmapi>
$<$<PLATFORM_ID:Windows>:strmiids>
$<$<PLATFORM_ID:Windows>:Qt5::Multimedia>
$<$<PLATFORM_ID:Linux>:Qt5::X11Extras>
$<$<PLATFORM_ID:Linux>:Libv4l2::Libv4l2>
$<$<PLATFORM_ID:Linux>:${PULSEAUDIO_LIBRARY}>
Expand Down
2 changes: 1 addition & 1 deletion languages/capturer_en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
<context>
<name>ScreenRecorder</name>
<message>
<location filename="../src/record/screenrecorder.cpp" line="223"/>
<location filename="../src/record/screenrecorder.cpp" line="254"/>
<source>Path: </source>
<translation></translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion languages/capturer_zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
<context>
<name>ScreenRecorder</name>
<message>
<location filename="../src/record/screenrecorder.cpp" line="223"/>
<location filename="../src/record/screenrecorder.cpp" line="254"/>
<source>Path: </source>
<translation>路径:</translation>
</message>
Expand Down
16 changes: 8 additions & 8 deletions src/media/devices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#include "linux-v4l2/linux-v4l2.h"

#elif _WIN32
#include <QCameraInfo>
#include <QAudioDeviceInfo>
#include "win-wasapi/enum-wasapi.h"
#include "win-dshow/enum-devices.h"
#endif

QList<QString> Devices::cameras() {
Expand All @@ -19,8 +19,8 @@ QList<QString> Devices::cameras() {
cameras.insert(QString::fromStdString(device.name_));
}
#elif _WIN32
for (const auto& info : QCameraInfo::availableCameras()) {
cameras.insert(info.description());
for (const auto& [name, id] : enum_video_devices()) {
cameras.insert(QString::fromStdWString(name));
}
#endif

Expand All @@ -38,8 +38,8 @@ QList<QString> Devices::microphones() {
}
pulse_unref();
#elif _WIN32
for (const auto &info: QAudioDeviceInfo::availableDevices(QAudio::AudioInput)) {
microphones.insert(info.deviceName());
for (const auto& [name, id] : enum_audio_endpoints(true)) {
microphones.insert(name);
}
#endif
return microphones.values();
Expand All @@ -57,8 +57,8 @@ QList<QString> Devices::speakers() {
}
pulse_unref();
#elif _WIN32
for (const auto &info: QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)) {
speakers.insert(info.deviceName());
for (const auto& [name, id] : enum_audio_endpoints(false)) {
speakers.insert(name);
}
#endif
return speakers.values();
Expand Down
Loading

0 comments on commit d36584b

Please sign in to comment.