Skip to content

Commit d077f5b

Browse files
committed
📚 Modified some variable names and information about preload-replay mode.
1 parent 6c670ec commit d077f5b

File tree

5 files changed

+41
-16
lines changed

5 files changed

+41
-16
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Elaina
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ Automatically enter preload-replay mode when the input file extension is `.badap
2828
usage: badapple [options] ...
2929
options:
3030
-i, --input video file (string [=./badapple.mp4])
31-
-o, --output [preloaded mode] output file (string [=])
31+
-o, --output [preload] output file (string [=])
3232
-a, --audio audio file (string [=])
3333
-m, --map font data file (string [=])
3434
-s, --scale width:height (string [=76:54])
3535
-r, --rate frame rate (double [=10])
3636
--not-clear don't clear screen (using ANSI) before print a frame
3737
--contrast-enhancement contrast Enhancement
38-
--preload [preload mode]
38+
--preload [preload]
3939
--play-audio play audio with ffplay
4040
-?, --help print this message
4141
```
@@ -46,6 +46,14 @@ options:
4646
git clone --recurse-submodules --remote-submodule [email protected]:userElaina/Bad-Apple.git
4747
```
4848

49+
### To do
50+
51+
How to build OpenCV with MinGW-W64
52+
53+
### License
54+
55+
The code is available under the [MIT license](./LICENSE).
56+
4957
### How to use
5058

5159
**[Fonts Pre-processing](#fonts-pre-processing)**
@@ -56,10 +64,6 @@ git clone --recurse-submodules --remote-submodule [email protected]:userElaina/Bad-
5664
**[Linux-FFmpeg](#linux-ffmpeg)**
5765
**[Linux-OpenCV](#linux-opencv)**
5866

59-
### To do
60-
61-
How to build OpenCV with MinGW-W64
62-
6367
#### Fonts Pre-processing
6468

6569
##### Dependencies

badapple.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ int main(int argc, char** argv) {
99
cmdline::parser a;
1010
a.set_program_name("badapple");
1111
a.add<std::string>("input", 'i', "video file", false, "./badapple.mp4");
12-
a.add<std::string>("output", 'o', "[preloaded mode] output file", false, "");
12+
a.add<std::string>("output", 'o', "[preload] output file", false, "");
1313
a.add<std::string>("audio", 'a', "audio file", false, "");
1414
a.add<std::string>("map", 'm', "font data file", false, "");
1515
a.add<std::string>("scale", 's', "width:height", false, "76:54");
1616
a.add<double>("rate", 'r', "frame rate", false, 10.0);
1717
a.add("not-clear", '\0', "don't clear screen (using ANSI) before print a frame");
1818
a.add("contrast-enhancement", '\0', "contrast Enhancement");
19-
a.add("preload", '\0', "[preload mode]");
19+
a.add("preload", '\0', "[preload]");
2020
a.add("play-audio", '\0', "play audio with ffplay");
2121
a.parse_check(argc, argv);
2222

badapple.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#include "decode_preload.hpp"
3+
#include "decode_replay.hpp"
44

55
#ifdef DECODE_FFMPEG
66
#include "decode_ffmpeg.hpp"
@@ -51,7 +51,7 @@ inline int play(
5151
}
5252

5353
if(endswith(video,".badapple")){
54-
return play_preload(video,audio,not_clear,play_audio);
54+
return replay(video,audio,not_clear,play_audio);
5555
}
5656

5757
Font *map = new Font(font);
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include "base.hpp"
44

5-
namespace decode_preload {
5+
namespace decode_replay {
66
FILE* fp;
77
inline void pt(int c) {
88
fputc(c, fp);
@@ -26,10 +26,10 @@ inline int r() {
2626
}
2727
return ans;
2828
}
29-
} // namespace decode_preload
29+
} // namespace decode_replay
3030

3131
inline void compress(int x, int y, int clk, FILE* _fp) {
32-
using namespace decode_preload;
32+
using namespace decode_replay;
3333
fp = _fp;
3434
w(x);
3535
pt(32);
@@ -41,12 +41,12 @@ inline void compress(int x, int y, int clk, FILE* _fp) {
4141
pt(10);
4242
}
4343

44-
inline int play_preload(
44+
inline int replay(
4545
std::string video,
46-
std::string audio, // default use video
46+
std::string audio,
4747
int not_clear = 0,
4848
int play_audio = 0) {
49-
using namespace decode_preload;
49+
using namespace decode_replay;
5050

5151
fp = fopen(video.c_str(), "r");
5252

0 commit comments

Comments
 (0)