Skip to content

Commit 0eafbd0

Browse files
committed
change
0 parents  commit 0eafbd0

File tree

12 files changed

+2157
-0
lines changed

12 files changed

+2157
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # 当推送 v* 标签时触发 (如 v1.0, v1.0.0)
7+
workflow_dispatch: # 允许手动触发
8+
9+
jobs:
10+
build:
11+
runs-on: windows-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup CMake
18+
uses: lukka/get-cmake@latest
19+
20+
- name: Setup MSBuild
21+
uses: microsoft/setup-msbuild@v1.1
22+
23+
- name: Configure CMake
24+
run: |
25+
mkdir build
26+
cd build
27+
cmake .. -G "Visual Studio 17 2022" -A x64
28+
29+
- name: Build Release
30+
run: |
31+
cd build
32+
cmake --build . --config Release
33+
34+
- name: Prepare artifacts
35+
run: |
36+
mkdir release
37+
copy build\bin\Release\wasapi_capture.exe release\
38+
copy README.md release\
39+
copy README_CN.md release\
40+
copy docs\QUICK_START.md release\
41+
42+
- name: Upload artifacts
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: wasapi_capture-windows-x64
46+
path: release/
47+
48+
- name: Create Release
49+
if: startsWith(github.ref, 'refs/tags/')
50+
uses: softprops/action-gh-release@v1
51+
with:
52+
files: |
53+
release/wasapi_capture.exe
54+
release/README.md
55+
release/README_CN.md
56+
release/QUICK_START.md
57+
draft: false
58+
prerelease: false
59+
generate_release_notes: true
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+

.gitignore

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Build directories
2+
build/
3+
bin/
4+
obj/
5+
6+
# Compiled executables
7+
*.exe
8+
*.dll
9+
*.so
10+
*.dylib
11+
12+
# CMake
13+
CMakeCache.txt
14+
CMakeFiles/
15+
cmake_install.cmake
16+
Makefile
17+
18+
# Visual Studio
19+
*.sln
20+
*.vcxproj
21+
*.vcxproj.filters
22+
*.vcxproj.user
23+
.vs/
24+
*.suo
25+
*.user
26+
27+
# Visual Studio Code
28+
.vscode/
29+
*.code-workspace
30+
31+
# Temporary files
32+
*.tmp
33+
*.temp
34+
*.log
35+
*.obj
36+
*.pdb
37+
*.ilk
38+
39+
# macOS
40+
.DS_Store
41+
._*
42+
43+
# Windows
44+
Thumbs.db
45+
ehthumbs.db
46+
Desktop.ini
47+
48+
# IDE
49+
*.swp
50+
*~
51+
.idea/
52+

CMakeLists.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
cmake_minimum_required(VERSION 3.15)
2+
project(WASAPICapture)
3+
4+
set(CMAKE_CXX_STANDARD 17)
5+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
6+
7+
# Add executable
8+
add_executable(wasapi_capture src/wasapi_capture.cpp)
9+
10+
# Link required Windows libraries
11+
target_link_libraries(wasapi_capture
12+
ole32
13+
psapi
14+
)
15+
16+
# Set output directory
17+
set_target_properties(wasapi_capture PROPERTIES
18+
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
19+
)
20+
21+
# Windows specific settings
22+
if(MSVC)
23+
target_compile_options(wasapi_capture PRIVATE /W4)
24+
# Set subsystem to console
25+
set_target_properties(wasapi_capture PROPERTIES
26+
LINK_FLAGS "/SUBSYSTEM:CONSOLE"
27+
)
28+
endif()
29+

PROJECT_STRUCTURE.md

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# 项目结构说明 / Project Structure
2+
3+
## 📁 当前项目结构 / Current Structure
4+
5+
```
6+
audiotee-wasapi/
7+
├── .github/
8+
│ └── workflows/
9+
│ └── build-release.yml # GitHub Actions 自动构建工作流
10+
│ # GitHub Actions auto-build workflow
11+
├── src/
12+
│ └── wasapi_capture.cpp # 主程序源代码
13+
│ # Main program source code
14+
├── scripts/
15+
│ ├── build.bat # CMake 构建脚本(Windows)
16+
│ │ # CMake build script (Windows)
17+
│ └── build_simple.bat # cl.exe 直接编译脚本
18+
│ # cl.exe direct compilation script
19+
├── docs/
20+
│ ├── QUICK_START.md # 快速开始指南
21+
│ │ # Quick start guide
22+
│ └── RELEASE_GUIDE.md # 发布指南
23+
│ # Release guide
24+
├── CMakeLists.txt # CMake 配置文件
25+
│ # CMake configuration file
26+
├── build.bat # 快速构建快捷方式(调用 scripts/build.bat)
27+
│ # Quick build shortcut (calls scripts/build.bat)
28+
├── README.md # 英文主文档
29+
│ # Main documentation (English)
30+
├── README_CN.md # 中文文档
31+
│ # Chinese documentation
32+
├── .gitignore # Git 忽略规则
33+
│ # Git ignore rules
34+
└── PROJECT_STRUCTURE.md # 本文件 / This file
35+
```
36+
37+
## 📂 目录说明 / Directory Description
38+
39+
### `.github/workflows/`
40+
包含 GitHub Actions 配置文件,用于自动化构建和发布。
41+
Contains GitHub Actions configuration files for automated building and releasing.
42+
43+
### `src/`
44+
存放所有源代码文件。
45+
Contains all source code files.
46+
47+
### `scripts/`
48+
存放构建脚本和其他辅助脚本。
49+
Contains build scripts and other helper scripts.
50+
51+
### `docs/`
52+
存放项目文档(除了主 README)。
53+
Contains project documentation (except main README).
54+
55+
## 🔨 构建说明 / Build Instructions
56+
57+
### 快速构建 / Quick Build
58+
在项目根目录直接运行:
59+
Run in project root:
60+
```bash
61+
build.bat
62+
```
63+
64+
### 使用 CMake / Using CMake
65+
```bash
66+
scripts\build.bat
67+
```
68+
或手动执行 / Or manually:
69+
```bash
70+
mkdir build
71+
cd build
72+
cmake .. -G "Visual Studio 17 2022" -A x64
73+
cmake --build . --config Release
74+
```
75+
76+
### 使用 cl.exe / Using cl.exe
77+
```bash
78+
scripts\build_simple.bat
79+
```
80+
81+
## 📝 文档位置 / Documentation Location
82+
83+
- **主文档 / Main README**: `README.md` (英文 / English)
84+
- **中文文档 / Chinese README**: `README_CN.md`
85+
- **快速开始 / Quick Start**: `docs/QUICK_START.md`
86+
- **发布指南 / Release Guide**: `docs/RELEASE_GUIDE.md`
87+
- **项目结构 / Project Structure**: `PROJECT_STRUCTURE.md` (本文件 / This file)
88+
89+
## 🎯 为什么要重新组织? / Why Reorganize?
90+
91+
### 优点 / Benefits
92+
93+
1. **更清晰的结构 / Clearer Structure**
94+
- 源代码、脚本、文档分离
95+
- Source code, scripts, and docs are separated
96+
97+
2. **更易维护 / Easier Maintenance**
98+
- 每个目录有明确的职责
99+
- Each directory has a clear responsibility
100+
101+
3. **更专业 / More Professional**
102+
- 符合开源项目的标准结构
103+
- Follows standard open-source project structure
104+
105+
4. **更易扩展 / Easier to Extend**
106+
- 添加新功能时目录结构清晰
107+
- Clear directory structure when adding new features
108+
109+
## 🚀 Git 提交 / Git Commit
110+
111+
重新组织后,需要提交这些更改:
112+
After reorganization, commit these changes:
113+
114+
```bash
115+
# 查看更改
116+
git status
117+
118+
# 添加所有文件
119+
git add .
120+
121+
# 提交
122+
git commit -m "Reorganize project structure: separate src, scripts, and docs"
123+
124+
# 推送到 GitHub
125+
git push origin main
126+
```
127+
128+
## ⚙️ 已更新的文件 / Updated Files
129+
130+
以下文件已经自动更新以适应新结构:
131+
The following files have been automatically updated for the new structure:
132+
133+
-`CMakeLists.txt` - 更新源文件路径
134+
-`scripts/build.bat` - 更新路径导航
135+
-`scripts/build_simple.bat` - 更新源文件路径
136+
-`.github/workflows/build-release.yml` - 更新构建路径
137+
-`README.md` - 更新项目结构和构建说明
138+
-`README_CN.md` - 更新项目结构和构建说明
139+
-`build.bat` - 新建快捷方式脚本
140+
-`.gitignore` - 新建忽略规则文件
141+
142+
## 📦 构建产物 / Build Artifacts
143+
144+
构建产物仍然输出到 `build/` 目录(已在 .gitignore 中):
145+
Build artifacts are still output to `build/` directory (ignored in .gitignore):
146+
147+
```
148+
build/
149+
└── bin/
150+
└── Release/
151+
└── wasapi_capture.exe
152+
```
153+
154+
---
155+
156+
**注意 / Note**: 本次重新组织不影响程序功能,只是优化了项目结构。
157+
This reorganization doesn't affect program functionality, it just optimizes the project structure.
158+

0 commit comments

Comments
 (0)